結果
| 問題 |
No.2124 Guess the Permutation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-18 21:51:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 612 bytes |
| コンパイル時間 | 1,660 ms |
| コンパイル使用メモリ | 171,732 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 1.00 |
| 最終ジャッジ日時 | 2024-09-20 02:14:53 |
| 合計ジャッジ時間 | 4,198 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
//ios::sync_with_stdio(false);
//cin.tie(0);
int N, v2 = 0;
cin >> N;
vector<ll> a(N);
vector<bool> used(N, false);
for(int i = 0; i + 1 < N; i++){
ll v;
cout << "? " << 1 << " " << i + 1 << '\n';
cin >> v;
a[i] = v - (i >= 1 ? a[i - 1] : 0);
used[a[i] - 1] = true;
}
int v = min_element(used.begin(), used.end()) - used.begin();
a.back() = v + 1;
cout << "!";
for(int i = 0; i < N; i++){
cout << " " << a[i];
}
cout << '\n';
}