結果
問題 |
No.2124 Guess the Permutation
|
ユーザー |
![]() |
提出日時 | 2022-11-18 21:22:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 497 bytes |
コンパイル時間 | 1,924 ms |
コンパイル使用メモリ | 194,296 KB |
最終ジャッジ日時 | 2025-02-08 21:21:27 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 */