結果

問題 No.2124 Guess the Permutation
コンテスト
ユーザー 👑 tails
提出日時 2022-11-18 21:33:56
言語 Perl
(5.44.0)
コンパイル:
perl -cw _filename_
実行:
perl -X _filename_
結果
AC  
実行時間 117 ms / 2,000 ms
+ 1µs
コード長 156 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 41 ms
コンパイル使用メモリ 7,724 KB
実行使用メモリ 9,700 KB
平均クエリ数 374.60
最終ジャッジ日時 2026-08-31 12:12:41
合計ジャッジ時間 1,132 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #
raw source code

$|=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