标签:opened space 第一个 个数 ide close view start ems
ross rachel
4
ross joey
rachel phoebe
phoebe monica
monica chandler
ross rachel
joey rachel
joey phoebe
joey monica
joey chandler
icm codeforces
1
codeforces technex
icm codeforces
icm technex
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 5 string s1,s2; 6 string t1,t2; 7 int n; 8 9 int main() 10 { 11 cin>>s1>>s2; 12 cin>>n; 13 14 for(int i=0;i<=n;i++) 15 { 16 cout<<s1<<" "<<s2<<endl; 17 if(i!=n)cin>>t1>>t2; 18 if(t1==s1)s1=t2; 19 else s2=t2; 20 } 21 return 0; 22 }
3
2
1 1 2
4
2
2 1 1 2
1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 6 int n; 7 int a[100005]; 8 int isPrime(int x) 9 { 10 for(int i=2;i*i<=x;i++) 11 if(x%i==0)return 0; 12 return 1; 13 } 14 int main() 15 { 16 while(~scanf("%d",&n)) 17 { 18 memset(a,0,sizeof(a)); 19 int ans=1; 20 for(int i=1;i<=n;i++) 21 { 22 if(isPrime(i+1))a[i]=1; 23 else a[i]=2,ans=2; 24 } 25 printf("%d\n",ans); 26 for(int i=1;i<n;i++) 27 printf("%d ",a[i]); 28 printf("%d\n",a[n]); 29 } 30 return 0; 31 }
4 2
2 2 2 2
8
4 -3
3 -6 -3 12
3
3 3
1 0 1
2 1 3
2 1 2
2 2 3
NO
3 3
1 0 1
3 1 2 3
1 2
2 1 3
YES
3 3
1 0 1
3 1 2 3
2 1 2
1 3
NO
7 1
6
10 2
4
4 1
1 3
1 2
6 3
1 3
1 4
1 5
2 1 2 3
1
1014 1014
1
2
1 1e
1 f
1
0
2
1 abc
d0e fe23
412
28464
标签:opened space 第一个 个数 ide close view start ems
原文地址:http://www.cnblogs.com/backlit/p/6537069.html