結果
| 問題 | No.2124 Guess the Permutation |
| コンテスト | |
| ユーザー |
ぷら
|
| 提出日時 | 2022-11-18 21:22:58 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 497 bytes |
| 記録 | |
| コンパイル時間 | 1,182 ms |
| コンパイル使用メモリ | 211,248 KB |
| 実行使用メモリ | 30,032 KB |
| 平均クエリ数 | 375.60 |
| 最終ジャッジ日時 | 2026-06-28 13:44:08 |
| 合計ジャッジ時間 | 2,440 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int sum = (1+N)*N/2;
vector<int>ans(N);
for(int i = 0; i < N-1; i++) {
cout << "? " << i+2 << " " << N << endl;
int a;
cin >> a;
ans[i] = sum-a;
sum = a;
}
ans[N-1] = sum;
cout << "! " << endl;
for(int i = 0; i < N; i++) {
cout << ans[i];
if(i+1 != N) {
cout << " ";
}
}
cout << endl;
}
/*
4 3 2 1 */
ぷら