QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#916895 | #9133. Function with Many Maximums | Dalek_of_Rivia# | TL | 0ms | 3584kb | C++23 | 676b | 2025-02-27 00:31:44 | 2025-02-27 00:31:44 |
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;
while(((n+1-2*i)*a+c)%(n+1-2*i-3)!=0) c++;
cout<<c<<" ";
a=((n+1-2*i)*a+c)/(n+1-2*i-3);
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
4
output:
7 7000000 7000005 12600001 12600003 29400003 29400004 147000016
result:
ok n=7, max_a=147000016, max_num=4 >= 4
Test #2:
score: -100
Time Limit Exceeded
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...