QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#916896#9133. Function with Many MaximumsDalek_of_Rivia#WA 10ms3584kbC++23675b2025-02-27 00:35:422025-02-27 00:35:43

Judging History

This is the latest submission verdict.

  • [2025-02-27 00:35:43]
  • Judged
  • Verdict: WA
  • Time: 10ms
  • Memory: 3584kb
  • [2025-02-27 00:35:42]
  • Submitted

answer

#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    int T=1;
    //cin>>T;
    
    for(int dalekofrivia=T; dalekofrivia>0; dalekofrivia--){
        int b;
        cin>>b;
        //b=100000;
        int n = 2*b-1;
        cout<<n<<endl;
        int a = n*1000000;
        for(int i=0; i<b; i++){
            cout<<a<<" ";
            if(i+1!=b){
                int c = a+1;
                c+=n+1-2*i-3-((n+1-2*i)*a+c)%(n+1-2*i-3);
                cout<<c<<" ";
                a=((n+1-2*i)*a+c)/(n+1-2*i-3);
            }
        }
    }

    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3584kb

input:

4

output:

7
7000000 7000005 12600001 12600003 29400003 29400005 147000017 

result:

ok n=7, max_a=147000017, max_num=4 >= 4

Test #2:

score: -100
Wrong Answer
time: 10ms
memory: 3456kb

input:

100000

output:

199999
199999000000 199999199877 200003000041 200003199072 200007000202 200007197427 200011000483 200011194942 200015000884 200015191617 200019001405 200019187452 200023002046 200023182447 200027002807 200027176602 200031003688 200031169917 200035004689 200035162392 200039005810 200039154027 2000430...

result:

wrong answer Integer element a[110559] equals to 1000011155451, violates the range [1, 10^12]