結果

問題 No.2124 Guess the Permutation
ユーザー tailstails
提出日時 2022-11-18 23:27:54
言語 Perl
(5.38.2)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 5,344 KB
実行使用メモリ 27,892 KB
平均クエリ数 374.60
最終ジャッジ日時 2023-10-20 08:27:00
合計ジャッジ時間 2,088 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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