結果
| 問題 | No.2124 Guess the Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-21 01:35:58 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 2,000 ms |
| コード長 | 434 bytes |
| 記録 | |
| コンパイル時間 | 426 ms |
| コンパイル使用メモリ | 89,856 KB |
| 実行使用メモリ | 29,776 KB |
| 平均クエリ数 | 374.60 |
| 最終ジャッジ日時 | 2026-06-29 01:57:10 |
| 合計ジャッジ時間 | 1,994 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n;cin>>n;
vector<int> A(n);
int sm = n*(n+1)/2;
for(int i = 0; n-2 > i; i++){
cout << "? " << 1 << " " << n-i-1 << endl;
int x;cin>>x;
A[n-i-1] = sm-x;
sm = x;
}
cout << "? 2 3" << endl;
int x;cin>>x;
A[1] = x-A[2];
A[0] = sm-A[1];
cout << "! ";
for(int i = 0; n > i; i++){
cout << A[i] << " ";
}
cout << endl;
}