Task: | Leikkijät |
Sender: | OorigamiK |
Submission time: | 2025-01-18 16:35:18 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
#4 | WRONG ANSWER | 0 |
#5 | WRONG ANSWER | 0 |
#6 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.00 s | 1, 2, 5, 6 | details |
#2 | WRONG ANSWER | 0.00 s | 1, 2, 3, 5, 6 | details |
#3 | WRONG ANSWER | 0.00 s | 1, 2, 5, 6 | details |
#4 | WRONG ANSWER | 0.00 s | 1, 2, 4, 5, 6 | details |
#5 | WRONG ANSWER | 0.00 s | 2, 5, 6 | details |
#6 | WRONG ANSWER | 0.00 s | 2, 3, 5, 6 | details |
#7 | WRONG ANSWER | 0.00 s | 2, 5, 6 | details |
#8 | WRONG ANSWER | 0.00 s | 2, 4, 5, 6 | details |
#9 | ACCEPTED | 0.01 s | 5, 6 | details |
#10 | WRONG ANSWER | 0.08 s | 6 | details |
#11 | WRONG ANSWER | 0.00 s | 1, 2, 5, 6 | details |
#12 | WRONG ANSWER | 0.05 s | 6 | details |
#13 | ACCEPTED | 0.00 s | 3, 5, 6 | details |
#14 | WRONG ANSWER | 0.00 s | 3, 5, 6 | details |
#15 | ACCEPTED | 0.01 s | 4, 5, 6 | details |
#16 | WRONG ANSWER | 0.00 s | 5, 6 | details |
#17 | WRONG ANSWER | 0.08 s | 6 | details |
#18 | WRONG ANSWER | 0.00 s | 4, 5, 6 | details |
#19 | WRONG ANSWER | 0.00 s | 5, 6 | details |
#20 | WRONG ANSWER | 0.07 s | 6 | details |
#21 | WRONG ANSWER | 0.08 s | 6 | details |
#22 | WRONG ANSWER | 0.00 s | 5, 6 | details |
Code
#include <iostream> #include <vector> using namespace std; void calculateOrder(vector<int>& order, int n){ order[0]=2; int offset=2; for (int i=1;i<n;i++){ if (order[i-1]+offset<=n){ order[i]=(order[i-1]+offset); } else{ if (i==n-1){ order[i]=(2*n-(-1+2*(offset-(n-order[i-1]))))%n; if (order[i]==0){ order[i]=n; } break; } order[i]=-1+2*(offset-(n-order[i-1])); offset*=2; } } } int main(){ int t; cin>>t; std::vector<int> A(t); std::vector<int> B(t); for (int i=0;i<t;i++){ int a; int b; cin>>a>>b; A[i]=a; B[i]=b; } for (int i=0;i<t;i++){ if (A[i]%2==0){ if (B[i]==A[i]+2){ cout<<A[i]+2<<"\n"; } else if (B[i]==1){ if (A[i]!=2){ cout<<A[i]+1<<"\n"; } else{ cout<<2<<"\n"; } } else{ cout<<-1<<"\n"; } } else{ cout<<-1<<"\n"; } } } /*int leavingStep[1000000]; //2^20>1e6 int powersOfTwo[30]; int offsets[30]; void precompute(){ int offset=2; offsets[0]=0 for (int i=1;i<19;i++){ offsets[i]=offset; int k=powersOfTwo[i]; int index=offset; while(index<1000000){ leavingStep[index]=i; index+=k; } offset+=k/2; } //leavingStep } int check(int a, int b){ if (leavingStep[a]==leavingStep[b]){ if (b-a==powersOfTwo[leavingStep[a]]){ cout<<b<<std::endl; } } if (leavingStep[b]=leavingStep[a]+1){ int i=1; while (offsets[i]<b){ i++; } if (offsets[i]==b){ } } } int test(int a, int b){ return 0; } int main(){ powersOfTwo[0]=1; for (int i=1;i<30;i++){ powersOfTwo[i]=2*powersOfTwo[i-1]; } precompute(); } */
Test details
Test 1
Group: 1, 2, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 42 100 73 94 1 13 31 100 ... |
correct output |
---|
-1 -1 -1 -1 -1 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 2
Group: 1, 2, 3, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 54 3 42 44 30 1 52 3 ... |
correct output |
---|
54 44 31 52 15 ... |
user output |
---|
-1 44 31 -1 15 ... Truncated |
Test 3
Group: 1, 2, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 27 25 81 65 45 43 87 23 ... |
correct output |
---|
-1 -1 -1 139 -1 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 4
Group: 1, 2, 4, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 55 63 39 71 95 96 61 69 ... |
correct output |
---|
65 75 -1 72 98 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 5
Group: 2, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 222 56 871 832 207 364 919 980 ... |
correct output |
---|
-1 -1 -1 -1 -1 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 6
Group: 2, 3, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 892 3 332 334 820 822 42 1 ... |
correct output |
---|
892 334 822 43 108 ... |
user output |
---|
-1 334 822 43 -1 ... Truncated |
Test 7
Group: 2, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 77 93 319 575 509 381 675 707 ... |
correct output |
---|
98 607 574 713 919 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 8
Group: 2, 4, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 969 985 233 489 403 659 427 555 ... |
correct output |
---|
992 500 777 565 261 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 9
Group: 5, 6
Verdict: ACCEPTED
input |
---|
1000 10375 364462 501875 499131 495774 7544 133830 316225 ... |
correct output |
---|
-1 -1 -1 -1 -1 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 10
Group: 6
Verdict: WRONG ANSWER
input |
---|
100000 771321 298762 20752 494590 633649 443015 748804 831912 ... |
correct output |
---|
-1 -1 -1 -1 -1 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 11
Group: 1, 2, 5, 6
Verdict: WRONG ANSWER
input |
---|
900 1 1 1 2 1 3 1 4 ... |
correct output |
---|
-1 -1 3 -1 5 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 12
Group: 6
Verdict: WRONG ANSWER
input |
---|
90000 1 1 1 2 1 3 1 4 ... |
correct output |
---|
-1 -1 3 -1 5 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 13
Group: 3, 5, 6
Verdict: ACCEPTED
input |
---|
1000 237542 859435 965750 179154 972602 758585 453450 751662 ... |
correct output |
---|
-1 -1 -1 -1 -1 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 14
Group: 3, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 773164 1 870426 1 309736 309738 957602 957604 ... |
correct output |
---|
773165 870427 309738 957604 513118 ... |
user output |
---|
773165 870427 309738 957604 513118 ... Truncated |
Test 15
Group: 4, 5, 6
Verdict: ACCEPTED
input |
---|
1000 178896 591355 54364 110987 361539 818612 275401 926643 ... |
correct output |
---|
-1 -1 -1 -1 -1 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 16
Group: 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 704481 704465 696919 688727 941011 949203 171023 171025 ... |
correct output |
---|
-1 -1 951785 -1 -1 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 17
Group: 6
Verdict: WRONG ANSWER
input |
---|
100000 67901 133437 637521 637537 742567 742569 864043 864044 ... |
correct output |
---|
148638 637540 -1 -1 652457 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 18
Group: 4, 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 650375 650377 181841 443985 750137 750138 256969 322505 ... |
correct output |
---|
-1 484136 -1 341476 850152 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 19
Group: 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 1 3 1 5 1 9 1 17 ... |
correct output |
---|
3 5 10 20 40 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 20
Group: 6
Verdict: WRONG ANSWER
input |
---|
100000 1 3 1 5 1 9 1 17 ... |
correct output |
---|
3 5 10 20 40 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 21
Group: 6
Verdict: WRONG ANSWER
input |
---|
100000 999999 1 999999 3 999999 5 999999 7 ... |
correct output |
---|
1000002 1000005 1000000 1000011 1000001 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |
Test 22
Group: 5, 6
Verdict: WRONG ANSWER
input |
---|
1000 999999 1 999999 3 999999 5 999999 7 ... |
correct output |
---|
1000002 1000005 1000000 1000011 1000001 ... |
user output |
---|
-1 -1 -1 -1 -1 ... Truncated |