結果

問題 No.2496 LCM between Permutations
ユーザー 👑 p-adicp-adic
提出日時 2023-09-05 13:11:19
言語 cLay
(20240104-1)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 3,823 ms
コンパイル使用メモリ 181,724 KB
実行使用メモリ 24,372 KB
平均クエリ数 952.76
最終ジャッジ日時 2023-09-06 09:43:49
合計ジャッジ時間 6,629 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,556 KB
testcase_01 AC 24 ms
23,400 KB
testcase_02 AC 26 ms
23,544 KB
testcase_03 AC 26 ms
23,544 KB
testcase_04 AC 26 ms
23,568 KB
testcase_05 AC 26 ms
24,348 KB
testcase_06 AC 26 ms
24,036 KB
testcase_07 AC 25 ms
23,652 KB
testcase_08 AC 25 ms
23,544 KB
testcase_09 AC 26 ms
23,436 KB
testcase_10 AC 26 ms
23,628 KB
testcase_11 AC 24 ms
23,412 KB
testcase_12 AC 24 ms
23,388 KB
testcase_13 AC 25 ms
23,628 KB
testcase_14 AC 26 ms
24,312 KB
testcase_15 AC 30 ms
24,072 KB
testcase_16 AC 33 ms
24,024 KB
testcase_17 AC 35 ms
23,616 KB
testcase_18 AC 89 ms
24,372 KB
testcase_19 AC 70 ms
23,844 KB
testcase_20 AC 91 ms
23,412 KB
testcase_21 AC 82 ms
23,412 KB
testcase_22 AC 76 ms
23,820 KB
testcase_23 AC 103 ms
23,820 KB
testcase_24 AC 89 ms
23,676 KB
testcase_25 AC 111 ms
23,544 KB
testcase_26 AC 111 ms
24,336 KB
testcase_27 AC 107 ms
23,436 KB
testcase_28 AC 113 ms
24,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//interactive
ll@N,P=N,t,Q[2],L=0,A[2][N+1];if(N<2)wt("! 1 1");else{while(!isPrime(P))P--;rep(i,1,N+1){wt("?",i,i);rd(t);if(t%P<1)Q[L++]=i;}if(L<2)Q[1]=*Q;else{wt("?",*Q,Q[1]);rd(t);if(t%P)swap(Q[0],Q[1]);}rep(n,2)rep(i,1,N+1){if(i==Q[n])t=P*P;else{wt("?",n?Q[0]:i,n?i:Q[1]);rd(t);}A[n][i]=t/P;}wtSp("!");rep(n,2)rep(i,N)wtSp(A[n][i+1]);}
0