记录编号 |
33343 |
评测结果 |
AAAAAAAAAA |
题目名称 |
616.整理牙刷 |
最终得分 |
100 |
用户昵称 |
kaaala |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.004 s |
提交时间 |
2011-11-10 13:14:05 |
内存使用 |
0.27 MiB |
显示代码纯文本
#include<iostream>
#include<fstream>
#include<cstdlib>
using namespace std;
int n;
int main()
{
int i,a,b,c,d=1206;
ifstream fin("put.in");
ofstream fout("put.out");
fin>>n;
if(n==1)
{
fout<<"No Solution!"<<endl;
fin.close();
fout.close();
return 0;
}
a=0;
b=1;
for(i=3;i<=n;i++)
{
c=(i-1)*(a+b)%d;
a=b;
b=c;
}
fout<<b<<endl;
fin.close();
fout.close();
return 0;
}