結果

問題 No.2124 Guess the Permutation
ユーザー tailstails
提出日時 2022-11-18 21:33:56
言語 Perl
(5.38.2)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 156 bytes
コンパイル時間 604 ms
コンパイル使用メモリ 5,316 KB
実行使用メモリ 24,588 KB
平均クエリ数 374.60
最終ジャッジ日時 2023-10-20 06:20:36
合計ジャッジ時間 1,907 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
24,588 KB
testcase_01 AC 28 ms
24,588 KB
testcase_02 AC 24 ms
24,588 KB
testcase_03 AC 25 ms
24,588 KB
testcase_04 AC 27 ms
24,588 KB
testcase_05 AC 28 ms
24,588 KB
testcase_06 AC 43 ms
24,588 KB
testcase_07 AC 57 ms
24,588 KB
testcase_08 AC 57 ms
24,588 KB
testcase_09 AC 57 ms
24,588 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$|=1;
$n=<>;
$s=$n*($n+1)/2;
for(reverse 2..$n-1){
	print"? 1 $_\n";
	$p[$_]=$s+0-($s=<>);
}
print"? 2 3\n";
$p[1]=<>-$p[2];
$p[0]=$s-$p[1];
print"! @p\n";
0