結果
| 問題 |
No.2124 Guess the Permutation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-17 12:23:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 446 bytes |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 82,416 KB |
| 実行使用メモリ | 94,796 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2024-09-30 04:42:18 |
| 合計ジャッジ時間 | 2,129 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 9 |
ソースコード
import sys
def ask(l, r):
print('?', l, r, flush=True)
return int(input())
def solve(N):
answers = [0] * N
total_sum = ask(1, N)
for i in range(1, N):
two_sum = ask(i, i + 1)
answers[i - 1] = total_sum - two_sum
total_sum = two_sum
answers[-1] = total_sum
return answers
def main():
N = int(input())
answers = solve(N)
print('!', *answers)
if __name__ == "__main__":
main()