QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#514706 | #9167. Coprime Array | ucup-team1231# | AC ✓ | 388ms | 3956kb | C++14 | 509b | 2024-08-11 07:09:11 | 2024-10-14 07:52:36 |
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,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 100ms
memory: 3820kb
input:
9 6
output:
3 -1317431 843319 474121
result:
ok Correct
Test #2:
score: 0
Accepted
time: 16ms
memory: 3744kb
input:
14 34
output:
2 -930873 930887
result:
ok Correct
Test #3:
score: 0
Accepted
time: 108ms
memory: 3892kb
input:
1000000000 223092870
output:
2 999686249 313751
result:
ok Correct
Test #4:
score: 0
Accepted
time: 3ms
memory: 3840kb
input:
2 1000000000
output:
2 -760491 760493
result:
ok Correct
Test #5:
score: 0
Accepted
time: 112ms
memory: 3760kb
input:
649557664 933437700
output:
2 648626777 930887
result:
ok Correct
Test #6:
score: 0
Accepted
time: 77ms
memory: 3840kb
input:
33396678 777360870
output:
2 32465791 930887
result:
ok Correct
Test #7:
score: 0
Accepted
time: 351ms
memory: 3900kb
input:
48205845 903124530
output:
3 46830083 627743 748019
result:
ok Correct
Test #8:
score: 0
Accepted
time: 105ms
memory: 3824kb
input:
251037078 505905400
output:
2 250106191 930887
result:
ok Correct
Test #9:
score: 0
Accepted
time: 83ms
memory: 3896kb
input:
30022920 172746860
output:
2 29092033 930887
result:
ok Correct
Test #10:
score: 0
Accepted
time: 105ms
memory: 3780kb
input:
63639298 808058790
output:
2 62708411 930887
result:
ok Correct
Test #11:
score: 0
Accepted
time: 388ms
memory: 3828kb
input:
76579017 362768406
output:
3 75203255 627743 748019
result:
ok Correct
Test #12:
score: 0
Accepted
time: 342ms
memory: 3956kb
input:
40423669 121437778
output:
3 39229581 951763 242325
result:
ok Correct
Test #13:
score: 0
Accepted
time: 84ms
memory: 3832kb
input:
449277309 720915195
output:
2 448346422 930887
result:
ok Correct
Test #14:
score: 0
Accepted
time: 364ms
memory: 3828kb
input:
81665969 919836918
output:
3 81145349 141047 379573
result:
ok Correct
Test #15:
score: 0
Accepted
time: 62ms
memory: 3832kb
input:
470578680 280387800
output:
2 469647793 930887
result:
ok Correct
Test #16:
score: 0
Accepted
time: 76ms
memory: 3836kb
input:
58450340 803305503
output:
2 57808918 641422
result:
ok Correct
Test #17:
score: 0
Accepted
time: 371ms
memory: 3768kb
input:
125896113 323676210
output:
3 124578673 843319 474121
result:
ok Correct
Test #18:
score: 0
Accepted
time: 112ms
memory: 3772kb
input:
381905348 434752500
output:
2 381724807 180541
result:
ok Correct
Test #19:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
78916498 653897673
output:
1 78916498
result:
ok Correct
Test #20:
score: 0
Accepted
time: 372ms
memory: 3836kb
input:
35787885 270845190
output:
3 34412123 627743 748019
result:
ok Correct
Extra Test:
score: 0
Extra Test Passed