|
|
"needs to make exactly k nano liters of the oxide in any of the test tubes" When you have k nano liters in a test tube that is not #1 the checker gives WA. My AC program was getting WA because my final test tube wasn't #1... Got WA #1 with the following output: 4 2 5 4 3 3 5 5 1 It seems correct, except for the fact the final tube is number 5, and not #1. Anyways, nice problem <3 k = 1 k = 2^m for some m k = n k = n-1 cases are enough for solve problem :) Does solution for (n,k) (19,18) exist? I only find the answer for (21,18). Do you guy have a better idea? 31 2 1 4 3 3 1 1 5 7 6 6 5 5 1 1 5 9 8 8 5 5 10 12 11 11 10 10 5 5 1 1 5 13 10 10 5 5 14 16 15 15 14 14 5 5 14 18 17 17 14 14 19 21 20 20 19 19 14 14 5 5 1 turns out n=19 you can reach state (10,9) and get to (1,18) this problem has the very beautiful soln. thanks to author. Consider the test "8 6" - there is solution, while your current logic likely outputs "-1" Try 19 18. My thanks! It's very useful test. )) this is my checker of this problem, it can't be wrong ,but WA on test 8 if(i>=n||a[i]!=k) { while(!(n==5&&k==5)) puts("orz"); puts("-1"); } else { printf("%d\n",cnt_ans); while(cnt_ans>3*n) puts("orz"); for(i=0;i<cnt_ans;i++) printf("%d %d\n",ax[i],ay[i]); for(i=0;i<n;i++) a[i]=1; for(i=0;i<cnt_ans;i++) { int id1=ax[i]-1,id2=ay[i]-1; while(id1>=n||id1<0||id2>=n||id2<0||id1==id2) puts("orz"); a[id1]-=a[id2]; a[id2]*=2; while(a[id1]<0) puts("orz"); } for(i=0;i<n;i++) { if(a[i]==k) break; } while(i!=0) puts("orz"); } it doesn't give ole but WA on test 8 sorry it's my mistake there is another no solution judge beforce this code... 4 2 1 => 2 0 1 1 1 4 3 => 2 0 2 0 1 3 1 => 4 0 0 0 1 1 5 => 4 в 1 => нестабильная смесь => улетает чистый кислород. 1 1 1 1 1 2 1 =>2 0 1 1 1 4 3 =>2 0 2 0 1 3 1 =>4 0 0 0 1 1 5 =>3 0 0 0 2 |
|
|