semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
	char a[250],b[50][200];
    int n[100],i,j=0,x,y=0,k=0,m,flag=0;
    for(i=0;a[i-1]!='\n';i++)   //?????
	{
    	scanf("%c",&a[i]);
	}
	a[i-1]='\0';
	i=0;
	do    //???????????????????
	{
		if(a[i]!=' '&&a[i]!=','&&a[i]!='\0')
		{
			b[j][k]=a[i];
			k++;
		}
		else
		{
			b[j][k]='\0';
			k=0;
			j++;
		}
		i++;
	}while(a[i-1]!='\0');
	x=j;

	//?????	
/*	for(i=0;i<x;i++)
	{
	    printf("%s\n",b[i]);
	}
*/ 

	for(i=0;i<x;i++)  //??????????????????????
	{
		n[i]=strlen(b[i]);	  
	}
	i=0;
    for(j=0;j<x;j++)  //??????????????????
	{
		if (n[j]>y)
		{
			y=n[j];
			m=j;
		}
	}
	printf("%s\n",b[m]);
	for(j=0;j<x;j++)  //??????????????????
	{
		if (n[j]<y&&n[j]>0)
		{
			y=n[j];
			m=j;
		}
	}
	printf("%s\n",b[m]);
    return 0;
}
int main()
{
	int i,j,n;
	char a[200][25];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",a[i]);
	}
	int maxi=0,mini=0;
	for(i=1;i<n;i++)
	{
		if(strlen(a[i])>strlen(a[maxi]))
			maxi=i;
		else if(strlen(a[i])<strlen(a[mini]))
			mini=i;
	}
	printf("%s\n%s",a[maxi],a[mini]);
	return 0;
}
int main()
{
	char sentence[N*31];
	int len,wordlen[N],max_wordlen,min_wordlen,max=0,min=0;
	int point[N],t=1;
	int i;
	gets(sentence);
	len=strlen(sentence);
	sentence[len]=' ';
	sentence[len+1]='\0';
	len=len+1;
	point[0]=0;
	for(i=0;i<len;i++)
	{
		if(sentence[i]==' ')
		{
			point[t]=i;
			point[t+1]=i+1;
			wordlen[(t-1)/2]=point[t]-point[t-1];
			t=t+2;
		}
		else if(sentence[i]==',')
		{
			point[t]=i;
			point[t+1]=i+2;
			wordlen[(t-1)/2]=point[t]-point[t-1];
			t=t+2;
			i++;
		}
	}
	max_wordlen=wordlen[0];
	min_wordlen=wordlen[0];
	for(i=0;i<=(t-3)/2;i++)
	{	
		if(max_wordlen<wordlen[i])
		{
			max_wordlen=wordlen[i];
			max=i;
		}
		if(min_wordlen>wordlen[i])
		{
			min_wordlen=wordlen[i];
			min=i;
		}
	}
	for(i=point[max*2];i<point[max*2+1];i++)
	{
		printf("%c",sentence[i]);
	}
	printf("\n");
	for(i=point[min*2];i<point[min*2+1];i++)
	{
		printf("%c",sentence[i]);
	}
	printf("\n");
	return 0;
}
int main(int argc, char* argv[])
{
	int n,m,i,j,max=0,min=100;
	char str[201][255];
	int a[201];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",str[i]);
		getchar();
		a[i]=strlen(str[i]);
        if(a[i]>max)  max=a[i];
		if(a[i]<min)   min=a[i];
	}
	//printf("%d %d",max,min);
    for(i=0;i<n;i++)
	{
		if(a[i]==max)  {
		 puts(str[i]);
	  printf("\n");
	  break;
		}
	}
	for(i=0;i<n;i++)
	{
	 if(a[i]==min)  
	 {
		puts(str[i]);
	 printf("\n");
	 break;
	 }
	}
	return 0;
}
int main()
{
	int i,n,l,j;
	int a[100],b[100];
	char e[100];
	char c[100][100];
	char d[100][100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",c[i]);
		strcpy(d[i],c[i]);
		a[i]=strlen(c[i]);
		b[i]=a[i];
	}
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			if(a[j]>a[i])
			{
				l=a[i];a[i]=a[j];a[j]=l;
				strcpy(e,d[i]);strcpy(d[i],d[j]);strcpy(d[j],e);
			}
		}
	}
	if(a[0]>a[1])
		printf("%s\n",d[0]);
	else
	{
		for(i=0;i<n;i++)
		{
			if(b[i]==a[0])
			{
				printf("%s\n",c[i]);
				break;
			}
		}
	}
	if(a[n-1]<a[n-2])
		printf("%s\n",d[n-1]);
	else
	{
		for(i=0;i<n;i++)
		{
			if(b[i]==a[n-1])
			{
				printf("%s\n",c[i]);
				break;
			}
		}
	}
	return 0;
}
//*************************************
//* ????1.cpp *
//* ??????1200012844 *
//* ?????2012?12?25? *
//* ??????????? *
//**************************************


int main()
{
	struct WORD
	{
		char word[40];
		int wordLen;
	}words[200];//???????

	int i = 1, j, k, count = 0;
	char a;

	while(cin >> words[i].word)
	{		
		words[i].wordLen = strlen(words[i].word);//??????
		count++;//????????
		i++;
		cin.get(a);
		if(a == '\n')//????
			break;
	}

	int flag = 0;//??????????????????
	for(i = 1; i <= count; i++)
	{
		k = 0;
		if(flag == 1)
			break;
		for(j = 1; j <= count; j++)
		{
			if(words[i].wordLen < words[j].wordLen)
				break;
			else
				k++;
			if(k == count)
			{
				cout << words[i].word << endl;
				flag = 1;
			}
		}
	}//?????????

	flag = 0;
	for(i = 1; i <= count; i++)
	{
		k = 0;
		if(flag == 1)
			break;
		for(j = 1; j <= count; j++)
		{
			if(words[i].wordLen > words[j].wordLen)
				break;
			else
				k++;
			if(k == count)
			{
				cout << words[i].word << endl;
				flag = 1;
			}
		}
	}//?????????
	return 0;
}
int main()
{
	char sz[2000];
	int b[200];
	b[0]=-1;
	int i,a,d=1,e=0,max=0,min=100,f,g,h=0,j;
	gets(sz);
	a=strlen(sz);
	for(i=0;i<a;i++)
	{
		if(sz[i]==' ' || sz[i]==',')
		{
			b[d]=i;
			e=b[d]-b[d-1]-1;
			break;
		}
	}
	for(i=0;i<a;i++)
	{
		if(sz[i]==' ' || sz[i]==',')
		{
			b[d]=i;
			if(e!=b[d]-b[d-1]-1)
			{
				h=1;
			}
			e=b[d]-b[d-1]-1;
			d++;
			if(e>max)
			{
				max=e;
				f=d-1;
			}
			if(e<min && e!=0)
			{
				min=e;
				g=d-1;
			}
		}
	}
	b[d]=i;
	if(e!=b[d]-b[d-1]-1)
	{
		h=1;
	}
	e=b[d]-b[d-1]-1;
	if(e>max)
	{
		max=e;
		f=d;
	}
	if(e<min && e!=0)
	{
		min=e;
		g=d;
	}
	if(h==0)
	{
		for(j=0;j<2;j++)
		{
			for(i=0;i<b[1];i++)
			{
				printf("%c",sz[i]);
			}
			printf("\n");
		}
	}
	else
	{
        for(i=b[f-1]+1;i<b[f];i++)
		{
		    printf("%c",sz[i]);
		} 
	    printf("\n");
	    for(i=b[g-1]+1;i<b[g];i++)
		{
		    printf("%c",sz[i]);
		} 
	    printf("\n");
	}
	return 0;
}
int main()
{
    int i,j=0,word=0,count=0;
    char str[1000];
    int p[50]={0};
    int l,n1,n2;
    int lengh[50]={0};
    gets(str);
    int len=strlen(str);
    for(i=0;i<len;i++){
        if(str[i]==' '){
        word=0;
        }
        else {
            if(word==0){
            word=1;
            p[j]=i;
            j++;
            count++;
            }
            }
        }
        for(i=j=0;i<count;i++){
            for(l=p[i];str[l]!=' '&&l<len;l++){
                lengh[j]++;
                }
                j++;
            }
            int max=0,min=100000;
            for(i=0;i<count;i++){
                if(lengh[i]>max){
                   n1=p[i];
                   max=lengh[i];
                    }
                    if(lengh[i]<min){
                        n2=p[i];
                        min=lengh[i];
                        }
                        }
              for(i=n1;str[i]!=' '&&i<len;i++)
              printf("%c",str[i]);
              printf("\n");
              for(i=n2;str[i]!=' '&&i<len;i++)
              printf("%c",str[i]);
              printf("\n");
              return 0;

    }
void main()
{
	char a[1000],b[50][100];
	int n,i,j,k,max=0,min;
	gets(a);
	n=strlen(a);
	min=n;
	for(i=0,k=0;i<n;i++)
	{
		if(a[i]!=' ') 
		{
			for(j=i;j<n;j++) 
			{
				if(a[j]==' ')break;
				else b[k][j-i]=a[j];
			}
			b[k++][j-i]='\0';
			i=j;
		}
		
	}
	for(i=0;i<k;i++) 
	{
		if((int)strlen(b[i])>max)max=strlen(b[i]);
		if((int)strlen(b[i])<min)min=strlen(b[i]);
	}
	for(i=0;i<k;i++) if((int)strlen(b[i])==max) {printf("%s\n",b[i]);break;}
	for(i=0;i<k;i++) if((int)strlen(b[i])==min) {printf("%s\n",b[i]);break;}
}
void main()
{
	int l,i,m=0,j,max,min,k=0,x=0,y=0,b[1000];
	char a[1000];char *p=a;char *q[50];
	gets(a);
	l=strlen(a);
	q[0]=&a[0];
		for(j=0;j<=l;j++)
		{
		    if(a[j]!=' '&&a[j]!='\0')
			 m++;
		    if(a[j]==' '||a[j]=='\0')
			{
			  a[j]='\0';
			   b[k]=m;
			   q[k+1]=&a[j+1];
			   m=0;
			   k++;			  			   
			}
		} 			
	max=b[0];min=b[0];
	for(i=1;i<k;i++)
	{
		if(b[i]>max)
		{
			max=b[i];
            x=i;
		}
		if(b[i]<min)
		{
			min=b[i];
			y=i;
		}
	}	
	printf("%s\n",q[x]);
		printf("%s\n",q[y]);
}
void main()
{
	char a[100][100];int b[100];
	int i;char c;
	for(i=0;;i++)
	{
		scanf("%s",a[i]);
		c=getchar();
		if(c=='\n') break;
	}
	int n=i+1;
	for(i=0;i<n;i++)
	{
		b[i]=strlen(a[i]);
	}
	int max=0;int min=100;int imax=0,imin=0;
	for(i=0;i<n;i++)
	{
		if(b[i]>max) {max=b[i];imax=i;}
		if(b[i]<min) {min=b[i];imin=i;}
	}
	printf("%s\n%s",a[imax],a[imin]);
}
int main()
{
    int u=0,b=0,n,i,d=0,j,c[1000]={0};
 char a[1000],w[1000];
 scanf("%d",&n); 
 for (i=0;i<n;i++) 
 {
    if (i==0)
    {
     a[0]='2';
     continue;
    }
    for (j=0;j<=0.4*n;j++)
    {
        if (  (a[j]-'0'<0)||(a[j]-'0'>9)  )
           a[j]='0';
       b=a[j]-'0';
       if (b*2>=10)
       {
       c[j+1]=1;
       a[j]=(b*2)%10+'0'+c[j];
       c[j]=0;
       }
       if (b*2<10)
       {
                  a[j]=b*2+'0'+c[j];
                   c[j]=0;
       }
     
     }

 }
 for (int t=strlen(a);t>=0;t--)
 {
 if (  (a[t]-'0'>=0)  &&  (a[t]-'0'<=9)  )
  {
  w[d]=a[t];
  d++;
  }
 }

  for (i=0;i<strlen(w);i++)
  {
   if (w[i]!='0')
   {
   u=i;
   break;
   }
  }
   for (i=u;i<strlen(w);i++)
{
   if (  (w[i]-'0'>=0)  &&  (w[i]-'0'<=9)  )
   printf("%c",w[i]);
}
if (n==0)
printf("1");
   }
int a[40] = {0}, b[40] = {0};
void f()
{
	int i, y;
	for (i = 0; i < 40; i++)
		b[i] = 0;
	for (i = 39; i > 0; i--)
	{
		y = a[i] * 2;
		b[i - 1] += y / 10;
		b[i] += y % 10;
		if (b[i] > 9)
		{
			b[i - 1]++;
			b[i] -= 10;
		}
	}
	for (i = 0; i < 40; i++)
		a[i] = b[i];
}
int main()
{
	int n, i, j;
	cin >> n;
	a[39] = 2;
	if (n == 0)
		cout << "1" << endl;
	else
	{
		for (i = 1; i < n; i++)
			f();
		for (i = 0; ;i++)
			if (a[i] != 0)
				break;
		for (j = i; j < 40; j++)
			cout << a[j];
		cout << endl;
	}
	return 0;
}
int main()
{
    int n ;
    cin>> n ;
    char a[100] = {0};
    a[0] = 1 ;
    int length = 1 ;
    for (int i = 0 ; i< n ; i++)
    {
        int add = 0 ;
        for (int j = 0 ; j<length ; j++)
        {
            a[j] *= 2 ;
            a[j] += add ;
            if (a[j] > 9)
            {
                int temp = a[j] ;
                add = temp /10 ;
                a[j] = temp % 10 ;
            }
            else
            {
                add = 0 ;
            }

        }
        if (add > 0)
        {
            a[length] = add ;
            length ++ ;
        }
    }
    for (int i = 0 ; i< length ; i++ )
        a[i] += '0' ;
    for (int i = length-1 ; i>= 0 ;i--)
        cout<<a[i] ;
    return  0;
}
void main()
{
	int n,i,l,a[100]={0},k=0;
	scanf("%d",&n);
	a[0]=1;
	for (l=0;l<n;l++)
	{
		for (i=0;i<=k;i++)
		  a[i]*=2;
		for (i=0;i<=k;i++)
		{
			a[i+1]+=a[i]/10;
			a[i]=a[i]%10;
		}
		if (a[k+1]!=0) k++;
	}
	for (i=k;i>=0;i--)
		printf("%d",a[i]);
	printf("\n");
}
char an[1000000];
void Re(char a[], char *a0)
{
	int len = strlen(a), i;
	for (i = 0; i < len; i++)
		*(a0 + len - i - 1) = a[i];
	*(a0 + len) = '\0';
}
void Mul( char *a)
{
	char a0[10000], re0[10000], re[10000];
	Re(a, a0);
	int len = strlen(a), t = 0, i, p;
	for (i = 0; i < len; i++)
	{
		p = t + (a0[i] - '0') * 2;
		re0[i] = (p % 10) + '0';
		t = p / 10;
	}
	re0[len] = t + '0';
	re0[len + 1] = '\0';
	if (re0[len] == '0')
		re0[len] = '\0';
	//cout<< "*" << re0 << endl;
	Re(re0, re);
	//cout<< "**" << re << endl;
	strcpy(an, re);
	//cout<< "***" << an << endl;
}
int main()
{
	char a[10000] = {'2'}, a0[10000];
	int lena, n, i;
	cin >> n;
	lena = strlen(a);
	if (n == 0)
	{
		cout << 1 << endl;
		return 0;
	}
	for (i = 1; i < n; i++)
	{
		Mul(a);
		strcpy(a, an);
		//cout << a << endl;
	}
	//cout << 
	cout << a << endl;
	//for (i = 0; i < strlen(an); i++)
	//	if (a[i] != '0')
	//		cout << a[i] ;
	return 0;
}
/**
* ???2?n??
* ?????
* ???10.12.20
**/

  
int a[100];
int n,i;
int main()
{
    cin>>n;
    a[0]=1;
    while(n--)
    {
        for(i=0;i<100;i++)      
        a[i]*=2;
        for(i=0;i<99;i++)
        {
            a[i+1]+=a[i]/10;
            a[i]%=10;   
        }
    }
    for(i=50;i>0&&a[i]==0;i--);//????? ????????? 
    for(;i>=0;i--)
        cout<<a[i];
        cout<<endl;
     return 0;  
  
  
}
//********************************
//*???5.??2?N?? **
//*?????? 1300017623 **
//*???2013.11.13  **
//********************************
int main()
{
	int n, flag = 0, tag = 0;
	int a[100] = {1};
	cin >> n;
	for (; n > 0; n--)
		for (int i = 0; i < 100; i++)
		{
			a[i] *= 2;
			if (flag)
				a[i]++;
			flag = 0;
			if (a[i] > 9)
			{
				flag = 1;
				a[i] -= 10;
			}
		}
	for (int i = 99; i >= 0; i--)
	{
		if (a[i] != 0 || tag)
		{
			tag = 1;
			cout << a[i];
		}
	}
		return 0;
}
int main()
{
	int a[MAXLEN]={0};
	int i,n,count=1;
	void multiply2(int a[MAXLEN]);

	cin >> n;
	a[0]=1;
	for (i=0;i<n;i++)			//calculate 2^n;
		multiply2(a);


	for (i=MAXLEN-1;i>=0;i--)	//find the highest bit
		if (a[i]!=0)
			break;


	for (;i>=0;i--)				//print result
		cout << a[i];
	cout << endl;
	

	return 0;
}

void multiply2(int a[MAXLEN])		//calculate a*2,and store the result in array a[]
{
	int i,l;
	for (l=MAXLEN-1;l>=0;l--)
		if (a[l]!=0)
			break;

	for (i=0;i<=l;i++)
		a[i] *= 2;
	for (i=0;i<l+2;i++)
		if ( a[i]>=10 )
		{
			a[i] -= 10;
			a[i+1]++;
		}
}
//********************************************
//* file : 1000012912_002.cpp                *
//* author : ???                          *
//* data : 2010.12.15                        *
//* function : ??2?N??                  *
//********************************************
int main()
{
	int n, i, j, ans[101];                       //ans???????100?
	cin >> n;
	memset(ans,0,sizeof(ans));                   //??????1
	ans[0] = 1;
	for ( i = 0; i < n; i++ )
	{
		for ( j = 0; j < n; j++ )
			ans[j] = ans[j]* 2;                  //???2
		for ( j = 0; j < n; j++ )
			if ( ans[j] >= 10 )
			{
				ans[j+1] += ans[j] / 10;            //??
				ans[j] %= 10;
			}
	}
	while ( ans[i] == 0 )
		i--;
	for(; i >= 0; i-- )
		cout << ans[i];
	cout << endl;
	return 0;
}
int main()
{
	//??n???????num???????????add???????flag?????????????????
	int n, num[50], add = 0, flag = 0;
	//?num????
	memset( num, 0, sizeof(num) );
	//?num[0]??1
	num[0] = 1;

	cin >> n;

	for ( int i = 0; i < n; i++ )//i????????????
	{
		for ( int j = 0; j < 50; j++ )//???????????????
		{
			num[j] = num[j] * 2;

			num[j]+=add;

			add = num[j] / 10;

			num[j] = num[j] % 10;
		}
	}
	
	for ( int i = 49; i >= 0; i-- )
        //??????????????flag?????0??????????????????
		if ( num[i] != 0 &&  flag == 0 )
		{
			cout << num[i];
		
			flag++;
		}
		//??????????????
		else

			if ( flag )

				cout << num[i];

	cout << endl;
	
	return 0;
}
int calculate(int);
int main()
{
    int n, i, j = 0;
    int flag = 0, a;
    int str1[100000]; 
    int str2[100000];
    cin >> n;
    if(n == 0)
    {
        cout << "1" << endl;
        return 0;
    }
    else
    {
        if(n == 1)
        {
             cout << "2" << endl;
             return 0;
        }
    memset(str1, -1, sizeof(str1));
    memset(str2, 0, sizeof(str2));
    str1[0] = 2;
    for(i = 1; i < n; i++)
    {
          while(str1[j] != -1)
          {
                  str2[j] = str1[j] * 2 + str2[j];
                  if(str2[j] >= 10)
                  {
                        str2[j] = str2[j] - 10;
                        str2[j + 1]++;
                  }
                  j++;
          }
          if(i == n - 1)
                  break;
          for(j = 0; j < 1000; j++)
          {
                  str1[j] = str2[j];
                  str2[j] = 0;
          }
          j = 0;
    }
    j = 100000 - 1;
    while(str2[j] == 0)
          j--;
    for(i = j; i >= 0; i--)
    {
          cout << str2[i];
    }
}
    return 0;
}
int main()
{
	int a[50],n;
	memset(a,0,sizeof(a));
	a[0]=1;
	cin>>n;
	while (n--)
	{
		for (int i=0;i<49;i++)
		{
			a[i] *= 2;
		}
		for (int i=0;i<49;i++)
		{
			while (a[i]>9)
			{
			    a[i] -= 10;
				a[i+1]++;
			}
		}
	}
	n=49;
	while (a[n]==0)
		n--;
	for (int i=n; i>=0;i--)
		cout<<a[i];

	return 0;
}
char a[100];
int n, i, j, k, times = 0;
int ex[100] = {0};

int main()
{
	cin >> n;
	if (n == 0)
	{
		cout << '1';
		return 0;
	}
	for (i = 0; i != 100; i++)
	{
		if (i == 0)
			a[i] = '1';
		else
			a[i] = '0';
	}                                   //???a???1
	for (i = 1; i != n + 1; i++)
	{
		for (j = 0; j != i; j++)
		{
			if (a[j] <= '4')
				a[j] = (a[j] - '0') * 2 + '0';
			else
			{
				a[j] = (a[j] - '0') * 2 + '0' - 10;
				ex[j + 1] = 1;
			}
		}
		for (k = 0; k != n; k++)
		{
			if (ex[k] == 1)
			{	
				a[k]++;
				ex[k] = 0;
			}
		}
	}
	for (i = n - 1; i != -1; i--)
	{
		if (a[i] == '0' && times == 0)
			continue;
		else
		{
			cout << a[i];
			times++;
		}
	}
	cout << endl;

	return 0;
}
int main()
{
	int i, j, len = 1, n;
	int ans[50] = {0};
	cin >> n;
	ans[0] = 1;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < len; j++)
		{
			ans[j] = ans[j] * 2;
		}
		for (j = 0; j < len; j++)
		{
			if (ans[j] > 9)
			{
				ans[j] -= 10;
				ans[j + 1] += 1;
				if (j == len - 1)
				{
					len++;
					break;
				}
			}
		}
	}
	for (i = 0; i < len; i++)
	{
		cout << ans[len - i - 1];
	}
	return 0;
}
int a[100] = {0}, len = 1;
void cal(int);
void print();

int main()
{
	int n;
	cin >> n;
	a[0] = 2;
	if(n > 0)
	{
		cal(n);
		print();
	}
	else
	{ 
		cout << "1" << endl;
	}
	return 0;
}

void cal(int x)
{
	int i;
	if(x != 1)
	{
		for(i = 0; i < len; i++)
		{
			a[i] *= 2;
		}
		for(i = 0; i < len; i++)
		{
			if(a[i] >= 10)
			{
				a[i] -= 10;
				a[i+1] += 1;
				if(i == len - 1)
				{
					len++;
				}
			}
		}
		cal(x - 1);
	}
}

void print()
{
	int i;
	for(i = len - 1; i >= 0; i--)
	{
		cout << a[i];
	}
	cout << endl;
}
//*****************************************
//* ?????2?N?? **
//* ?????? 1300012741 **
//* ???2013.10.30 **
//*****************************************


int main()
{
	char number[50] = { 2 }; // ????
	int i, j, N; // ??????????

	cin >> N;

	if ( N == 0 ) // ???????
	{
		cout << 1;
		return 0;
	}

	for ( i = 0; i < N - 1; i++ )
	{
		for ( j = 0; j < 50; j++ ) // ????
			number[j] *= 2;
		for ( j = 0; j < 50; j++ ) // ????
		{
			number[j + 1] += number[j] / 10;
			number[j] -= number[j] / 10 * 10;
		}		
	}
	for ( j = 49; j >= 0; j-- ) // ??????
	{
		if ( number[j] != 0 )
			break;
	}
	for ( i = j; i >= 0; i-- ) // ??????????
		printf( "%d", number[i] );

	return 0;
}
// ?????? ???1000010500 
// ??2?N?? 
// 2010-12-15


int main()
{
    int a[32],i,j,N;
    cin >> N;                   // N?? 
    memset(a,0,sizeof(a));      // ??? 
    if (N == 1)                 // 1??????2 
       cout << "2" << endl;
    else if (N == 0)
         cout << "1" << endl; 
    else
    {
        a[0] = 2;
        for (i = 1;i < N;i++)
        {
            for (j = 0;j < 32;j++)    // ????2 
                a[j] *= 2;
            for (j = 0;j < 32;j++)
            if (a[j] > 9)             // ?? 
            {
                     a[j] -= 10;
                     a[j + 1] ++;
            }
        }
        for (i = 31;i >= 0;i--)       // ?????0??? 
            if (a[i] != 0)
               break;
        for (i = i;i >= 0;i--)
            cout << a[i];
        cout << endl;
    }
    return 0;
}
int main()
{
    char a[40]={0};
    int b[40]={0};
    int i,j,k;
    a[0]='1';
    int n;
    cin>>n;
    for(i=0;i<n;i++)
    {
                    for(j=0;j<40;j++)
                    {
                                     if(a[j]==0)
                                     break;
                                     b[j]=(a[j]-'0')*2;
                    }
                    for(k=j-1;k>0;k--)
                    {
                                    if(b[k]>=10)
                                    {b[k]=b[k]-10;
                                    b[k-1]=b[k-1]+1;}
                    }
                    if(b[0]<10)
                    for(k=0;k<j;k++)
                    a[k]=b[k]+'0';
                    else
                    {a[0]='1';a[1]=b[0]-10+'0';
                    for(k=1;k<j;k++)
                    a[k+1]=b[k]+'0';}
    }
cout<<a;
return 0;

}
/*???????2?N??
 *??????
 *???2010/12/16
 *???1000010449
 */
void multiply(char *p)
{
	int num[70], i = 0, end;

	num[0] = 0;
	while (*(p + i) != '\0')
	{
		num[i + 1] = 2 * (*(p + i) - '0');
		i++;
	}

	end = i;
	for (i = end; i > 0; i--)
	{
		num[i - 1] += num[i] / 10;
		num[i] %= 10;
	}
	if (num[0] == 0)
		i = 1;
	else 
		i = 0;

	while (i <= end)
		*p++ = num[i++] + '0';
	*p = '\0';

	return;
}
int main()
{
	char result[71] = "1";
	int n, i;
	
	cin >> n;

	for (i = 0; i < n; i++)
		multiply(result);
	

	cout << result << endl;

	return 0;
}
int main ()
{
	int n;
	cin>>n;
	if(n==0) cout<<"1"<<endl;
	int k=99;
	int a[100]={2};
	for(int i=0;i<n-1&&n!=0;i++)
	{
		for(int j=0;j<n;j++)
		{
			a[j]=a[j]*2;
		}
		for(int j=0;j<n;j++)
		{
			if(a[j]>=10)
			{
				a[j+1]=a[j+1]+a[j]/10;
				a[j]=a[j]%10;
			}
		}
	}

	while(a[k]==0)
		k--;
	for(int j=k;j>=0&&n!=0;j--)
		cout<<a[j];
	cout<<endl;
	return 0;
}
int main()
{
	int n=0,i=0,x=0,y=0,a[100]={1},j=0,jin=0,s=0;//????,???????1,??????
	cin>>n;
	for(i=0;i<n;i++)
	{
		for(x=0;x<100;x++)
		{
			if(j==1)//????????????
				jin=1;
			else
				jin=0;
			if(a[x]<5)//???,????
			{
				a[x]=a[x]*2;
				j=0;
			}
			else//??,????,j=1
			{
				a[x]=a[x]*2-10;
				j=1;
			}
			if(jin==1)
				a[x]=a[x]+1;
		}
	}
	for(i=99;i>=0;i--)//???????????????,?????
	{
		if(a[i]!=0)
		{
			s=i;
			break;
		}
	}
	for(;s>=0;s--)//????
		cout<<a[s];
	return 0;
}
int main()
{
	int b[100] = {0};
	int n,i,count = 0,k = 1,j,flag = 0;
	cin >> n;
	b[0] = 1;
	for (j = 1;j <= n;j++)
	{
		for (i = 0;i < k;i++)
			b[i] = b[i] * 2;
		for (i = 0;i < k;i++)
		{
			if (i == k - 1 && b[i] >= 10)
				k++;
			if (b[i] >= 10)
			{
				b[i] = b[i] - 10;
			    b[i + 1]++;
			}
		}
	}
	for (i = 99;i >= 0;i--)
	{
		if (b[i] != 0)
			count = 1;
		if (count)
			cout << b[i];
	}
	return 0;
}
//**************************
//*  ??????2?N??  *
//*  ?  ?????        *
//*  ?  ??1000012738    * 
//*  ?  ??2010.12.21    *
//**************************

int main()
{
	int product[33] = {0}, i, j, n;        // ?????????????
	cin >> n;                              // ????
	product[0] = 1;                        // ??????1
	for(i = 0; i < n; i++)                 // ????
	{
		for(j = 0; j < 33; j++)            // ????2
		{
			product[j] *= 2;
		}
		for(j = 0; j < 33; j++)            // ???????
		{
			if(product[j] >= 10)           // ???10
			{
				product[j] -= 10;          // ???10
				product[j + 1] += 1;       // ????1
			}
		}
	}
	for(i = 32; i >= 0; i--)               // ????????????????????
		if(product[i] != 0)
			break;
	for( ; i >= 0; i--)                    // ????
	{
		cout << product[i];
	}
	return 0;
}
//???


int main()
{
	char a[1001];
	char p = NULL;
	a[0] = '2';
	int n, i, j, k = 0, k1 = 0;
	for (i = 1; i < 1001; i++)
		a[i] = '0';
	cin >> n;
	if (n == 0)
		cout << 1 << endl;
	else
	{
	for (i = 1; i < n; i++)
		for (j = 0; j < 1001; j++)
		{
			k1 = ((a[j] - '0') * 2 + k) / 10;
			a[j] = ((a[j] - '0') * 2 + k) % 10 + '0';
			k = k1;
		}
	for (i = 1000; i >= 0; i--)
		if (a[i] != '0')
			break;
	for (; i >= 0; i--)
		cout << a[i];
	cout << endl;
	}
	return 0;
}
/************************************************
**authour:	???				*
**number:	1000012905			*
**descripition:	??2?N??			*
************************************************/
int	result[101] = {0};	//????????????0  

void	yiwei(int);		//???????????  

int main()
{
	int	n;
	result[100] = 1;	//?????????????1  
	cin >> n;

	//? n ???  
	for (int i = 0; i < n; i ++)
	{
		//??????????2  
		for (int j = 0; j < 101; j ++)
		{result[j] = result[j] * 2;}
		//??10???????????????????  
		if(i % 10 == 0)
		{yiwei(100);}
	}
	yiwei(100);	//????????????  

	//?????? 
	int	*p = result;
	while(*p == 0)
	{p ++;}

	//??????  
	for (;p < result + 101; p ++)
	{cout << *p;}
	cout << endl;

	return 0;
}
void	yiwei(int n)
{
	//?????????????????  
	if(n == 0)
	{return;}

	//??? n ????????10?????????????  
	if(result[n] >= 10)
	{
		int	k = result[n] % 10;
		result[n - 1] += (int)(result[n] / 10);
		result[n] = k;
	}

	//????????????????? 
	yiwei(n - 1);

	return;
}
int main()
{
	int num, temp, up = 0, flag = 0;
	char m[100];
	for (int i = 1; i < 100;i++)
	{
		m[i] = '0';
	}
	m[0] = '1';
	cin >> num;
	for (int k = 0; k < num; k++)
	{
		for (int p = 0; p < 100;p++)
		{
			temp = (m[p] - '0') * 2;
			m[p] = temp % 10 + up + '0';
			up = temp /10 ;
		}
	}
	for (int r = 99; r >= 0; r--)
	{
		if ((m[r] == '0')&&(flag == 0))
			continue;
		cout << m[r];
		flag = 1;
	}
	return 0;
}
int num[500]={4,2,8,1,4,7,3,7,0,1};


void cul(int num[],int t)
{
	int s[500]={0},k=0;
	for (int j=0;j<500;j++)
	{
		s[j]=t*num[j]+k;
		num[j]=s[j]%10;
		k=s[j]/10;
	}
}

void out(int num[])
{
	int sum,i,j,k;
	for (i=0;i<500;i++)
    {
		sum=0;	
		for (j=i;j<500;j++)
		{
			sum+=num[j];
			if (sum>0)
				break;
		}
		if (sum==0)
			break;
	}
	for (k=i-1;k>=0;k--)
		cout << num[k];
}

int main()
{
	int n,sum=1;
	cin >> n;
	if (n<=30)
	{
		for (int i=0;i<n;i++)
			sum=2*sum;
		cout << sum <<endl;
	}
	else
	{
		n=n-30;
	do
	{	
		if (n>=3)
		{
			cul(num,8);
			n-=3;
		}
		if (n==2)
		{
			cul(num,4);
			n-=2;
		}
		if (n==1)
		{
			cul(num,2);
			n--;
		}
	}
	while (n!=0);
	out(num);
	}
	return 0;
}