QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#514706 | #9167. Coprime Array | ucup-team1231# | AC ✓ | 388ms | 3948kb | C++14 | 509b | 2024-08-11 07:09:11 | 2024-08-11 07:09:11 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int ss,x;
int main() {
cin>>ss>>x;
for(int s=1;s<=10;++s)
for(int i=1;i<=3000000;++i) {
int w[14];
w[0]=ss;
for(int j=1;j<s;++j)
w[j]=rand()%1000000+1,w[0]-=w[j];
for(int j=0;j<s;++j)
if(abs(__gcd(x,w[j]))!=1) {
goto S;
}
printf("%d\n",s);
for(int j=0;j<s;++j)
printf("%d ",w[j]);
return 0;
S:;
}
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 100ms
memory: 3788kb
input:
9 6
output:
3 -1317431 843319 474121
result:
ok Correct
Test #2:
score: 0
Accepted
time: 16ms
memory: 3796kb
input:
14 34
output:
2 -930873 930887
result:
ok Correct
Test #3:
score: 0
Accepted
time: 112ms
memory: 3756kb
input:
1000000000 223092870
output:
2 999686249 313751
result:
ok Correct
Test #4:
score: 0
Accepted
time: 3ms
memory: 3796kb
input:
2 1000000000
output:
2 -760491 760493
result:
ok Correct
Test #5:
score: 0
Accepted
time: 113ms
memory: 3732kb
input:
649557664 933437700
output:
2 648626777 930887
result:
ok Correct
Test #6:
score: 0
Accepted
time: 76ms
memory: 3880kb
input:
33396678 777360870
output:
2 32465791 930887
result:
ok Correct
Test #7:
score: 0
Accepted
time: 351ms
memory: 3804kb
input:
48205845 903124530
output:
3 46830083 627743 748019
result:
ok Correct
Test #8:
score: 0
Accepted
time: 104ms
memory: 3800kb
input:
251037078 505905400
output:
2 250106191 930887
result:
ok Correct
Test #9:
score: 0
Accepted
time: 79ms
memory: 3740kb
input:
30022920 172746860
output:
2 29092033 930887
result:
ok Correct
Test #10:
score: 0
Accepted
time: 105ms
memory: 3884kb
input:
63639298 808058790
output:
2 62708411 930887
result:
ok Correct
Test #11:
score: 0
Accepted
time: 388ms
memory: 3776kb
input:
76579017 362768406
output:
3 75203255 627743 748019
result:
ok Correct
Test #12:
score: 0
Accepted
time: 340ms
memory: 3948kb
input:
40423669 121437778
output:
3 39229581 951763 242325
result:
ok Correct
Test #13:
score: 0
Accepted
time: 83ms
memory: 3736kb
input:
449277309 720915195
output:
2 448346422 930887
result:
ok Correct
Test #14:
score: 0
Accepted
time: 363ms
memory: 3884kb
input:
81665969 919836918
output:
3 81145349 141047 379573
result:
ok Correct
Test #15:
score: 0
Accepted
time: 62ms
memory: 3824kb
input:
470578680 280387800
output:
2 469647793 930887
result:
ok Correct
Test #16:
score: 0
Accepted
time: 76ms
memory: 3804kb
input:
58450340 803305503
output:
2 57808918 641422
result:
ok Correct
Test #17:
score: 0
Accepted
time: 370ms
memory: 3808kb
input:
125896113 323676210
output:
3 124578673 843319 474121
result:
ok Correct
Test #18:
score: 0
Accepted
time: 112ms
memory: 3880kb
input:
381905348 434752500
output:
2 381724807 180541
result:
ok Correct
Test #19:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
78916498 653897673
output:
1 78916498
result:
ok Correct
Test #20:
score: 0
Accepted
time: 374ms
memory: 3728kb
input:
35787885 270845190
output:
3 34412123 627743 748019
result:
ok Correct
Extra Test:
score: 0
Extra Test Passed