QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#420068#8543. Periodic SequenceDark_nightWA 6ms3604kbC++14461b2024-05-24 14:27:342024-05-24 14:27:36

Judging History

你现在查看的是最新测评结果

  • [2024-05-24 14:27:36]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3604kb
  • [2024-05-24 14:27:34]
  • 提交

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 if(i==7)
            cout<<57<<' ';
        else
            cout<<(b+m-2)%m<<' ';
    }
    cout<<'\n';

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3552kb

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: 6ms
memory: 3604kb

input:

200000 567894337

output:

1 3 6 11 19 33 57 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 8th numbers differ - expected: '100', found: '87'