QOJ.ac
QOJ
QOJ is currently under a maintenance. It might be unavailable in the following a few hours.
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#916896 | #9133. Function with Many Maximums | Dalek_of_Rivia# | WA | 10ms | 3584kb | C++23 | 675b | 2025-02-27 00:35:42 | 2025-02-27 00:35:43 |
Judging History
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]