100114

打表找规律 第25项开始循环

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n;
int a[1010],c[1010];
inline bool cp(int x,int y)
{
	return x<y;
}
int main()
{
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	cin>>n;
	int x=1;
	a[1]=1;
	for(int i=2;i<=30;i++)
	{
		x*=2;
		int t=x,l=0;
		while(t>0)
		{
			c[++l]=t%10;
			t/=10;
		}
		sort(c+1,c+l+1,cp);
		for(int j=1;j<=l;j++)
		{
			a[i]*=10;
			a[i]+=c[j];
		}
		x=a[i];
	}
//	for(int i=1;i<=30;i++)
//		cout<<a[i]<<endl;
	if(n<=25)
	{
		cout<<a[n]<<endl;
		return 0;
	}
	cout<<a[(n-25)%6+25]<<endl;
//	cout<<a[(n-1)%25+1]<<endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
}
时间: 2025-01-11 15:40:10

100114的相关文章

codeforces GYM 100114 J. Computer Network 无相图缩点+树的直径

题目链接: http://codeforces.com/gym/100114 Description The computer network of “Plunder & Flee Inc.” consists of n servers and m two-way communication links. Two servers can communicate either through a direct link, or through a chain of links, by relayi

codeforces GYM 100114 J. Computer Network tarjan 树的直径 缩点

J. Computer Network Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description The computer network of “Plunder & Flee Inc.” consists of n servers and m two-way communication links. Two servers can communicate either thr

Codeforces GYM 100114 C. Sequence 打表

C. Sequence Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description Integer sequences are very interesting mathematical objects. Let us examine a sequence generated with the use of two operations: doubling and “digit

Codeforces GYM 100114 D. Selection 线段树维护DP

D. Selection Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description When selecting files in an application dialog, Vasya noted that he can get the same selection in different ways. A simple mouse click selects a sing

Codeforces Gym 100114 H. Milestones 离线树状数组

H. Milestones Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description The longest road of the Fairy Kingdom has n milestones. A long-established tradition defines a specific color for milestones in each region, with a

Codeforces GYM 100114 B. Island 水题

B. Island Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description On February 30th this year astronauts from the International Space Station flew over the Pacific Ocean and took a picture, on which was discovered a pr

Codeforces Gym 100114 A. Hanoi tower 找规律

A. Hanoi tower Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description you the conditions of this task. There are 3 pivots: A, B, C. Initially, n disks of different diameter are placed on the pivot A: the smallest dis

肿孕萝控稚ed42ze09s7i

一条小鱼当然不够他吃的,只是一会儿的工夫,霍雨浩就从河里插上来十几条半尺到一尺长的青鱼.由衷感谢每一位支持老三的书友们,我们终于双榜第一了.没别的,下周,咱们还每天三更,让大家看的过瘾,这是我唯一能报答你们支持的方式了.再次拜谢每一位书友的支持.徐三石第三个,"徐三石,外院五年级,四十三级防御系战魂宗."在魂力方面,他比贝贝还要略胜一筹.谁都听说过史莱克学院进来容易出去难这句话,但真的到了自己身上他们才感受到强烈的危机,再也没有人敢存有投机取巧的心思了.霍雨浩万万没想到,会在眼前这种情

五二一刚开始的恢复健康和是咖喱的合适的购款

http://bbs.9787.com/post/index/id/100090/ http://bbs.9787.com/post/index/id/100091/ http://bbs.9787.com/post/index/id/100092/ http://bbs.9787.com/post/index/id/100093/ http://bbs.9787.com/post/index/id/100094/ http://bbs.9787.com/post/index/id/100095