結果
問題 |
No.2124 Guess the Permutation
|
ユーザー |
![]() |
提出日時 | 2022-11-22 03:06:09 |
言語 | PHP (843.2) |
結果 |
AC
|
実行時間 | 94 ms / 2,000 ms |
コード長 | 453 bytes |
コンパイル時間 | 2,980 ms |
コンパイル使用メモリ | 32,020 KB |
実行使用メモリ | 49,260 KB |
平均クエリ数 | 374.60 |
最終ジャッジ日時 | 2024-09-22 14:46:27 |
合計ジャッジ時間 | 4,815 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php fscanf(STDIN,"%d",$N); $tot = 0; $memo = array_fill(1,$N,false); for($i=1;$i<=$N;++$i) $tot += $i; $tot_ = $tot; for($i=2;$i<$N;++$i){ echo implode(" ",["?",$i,$N]) . PHP_EOL; fscanf(STDIN,"%d",$x); $ans[] = $tot - $x; $tot -= end($ans); } echo implode(" ",["?",1,$N-1]) . PHP_EOL; fscanf(STDIN,"%d",$x); $last = $tot_ - $x; $ans[] = $tot_ - array_sum($ans) - $last; $ans[] = $last; echo "! " . implode(" ",$ans) . PHP_EOL; ?>