結果
| 問題 |
No.2124 Guess the Permutation
|
| コンテスト | |
| ユーザー |
hatsuka_iwa
|
| 提出日時 | 2023-01-02 22:49:24 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 471 bytes |
| コンパイル時間 | 1,448 ms |
| コンパイル使用メモリ | 168,656 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2024-11-27 01:24:52 |
| 合計ジャッジ時間 | 2,653 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, S, sum = 0; cin >> N;
vector<int> Answer;
for (int i = 2; i <= N; i++) {
cout << "? " << i << ' ' << N << endl;
cin >> S;
Answer.push_back((N + 1) * N / 2 - S - sum);
sum += Answer.at(i - 2);
}
cout << "! ";
for (int i = 0; i < (int)Answer.size(); i++) {
if (i > 0) cout << ' ';
cout << Answer.at(i);
}
cout << ' ' << (N + 1) * N / 2 - sum << endl;
return 0;
}
hatsuka_iwa