hdu Children’s Queue

时间:2023-03-10 03:28:50
hdu Children’s Queue

http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=3&sectionid=1&problemid=10

 #include <cstdio>
#include <cstring>
#include <algorithm>
#define maxn 300000
using namespace std; int n;
int a[][]; void inti()
{
a[][]=;
a[][]=;
a[][]=;
a[][]=;
for(int i=; i<=; i++)
{
int c=;
for(int j=; j<=; j++)
{
a[i][j]=a[i-][j]+a[i-][j]+a[i-][j]+c;
c=a[i][j]/;
a[i][j]%=;
}
}
} int main()
{
inti();
while(scanf("%d",&n)!=EOF)
{
int i=4a99;
while(i>=&&!a[n][i]) i--;
while(i>=)
{
printf("%d",a[n][i]);
i--;
}
printf("\n");
}
return ;
}