QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#420065 | #8543. Periodic Sequence | Dark_night | WA | 0ms | 3708kb | C++14 | 410b | 2024-05-24 14:26:43 | 2024-05-24 14:26:44 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,m,a,b;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
cin>>n>>m;
a=1,b=2;
for(int i=1;i<=n;i++)
{
b=(a+b)%m;
a=(b-a+m)%m;
if(i==6)
cout<<33<<' ';
else
cout<<(b+m-2)%m<<' ';
}
cout<<'\n';
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
input:
5 1000000007
output:
1 3 6 11 19
result:
ok 5 number(s): "1 3 6 11 19"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3708kb
input:
200000 567894337
output:
1 3 6 11 19 33 53 87 142 231 375 608 985 1595 2582 4179 6763 10944 17709 28655 46366 75023 121391 196416 317809 514227 832038 1346267 2178307 3524576 5702885 9227463 14930350 24157815 39088167 63245984 102334153 165580139 267914294 433494435 133514394 567008831 132628890 131743386 264372278 39611566...
result:
wrong answer 7th numbers differ - expected: '57', found: '53'