結果
| 問題 | 
                            No.2124 Guess the Permutation
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Fu_L
                         | 
                    
| 提出日時 | 2024-03-04 00:05:43 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 888 bytes | 
| コンパイル時間 | 2,158 ms | 
| コンパイル使用メモリ | 196,604 KB | 
| 最終ジャッジ日時 | 2025-02-20 00:38:58 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 1 | 
| other | WA * 9 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, a, b) for(ll i = a; i < b; ++i)
#define rrep(i, a, b) for(ll i = a; i >= b; --i)
constexpr ll inf = 4e18;
struct SetupIO {
    SetupIO() {
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout << fixed << setprecision(30);
    }
} setup_io;
int main(void) {
    int n;
    cin >> n;
    vector<int> p(n);
    int sum = n * (n + 1) / 2;
    rep(i, 1, n - 1) {
        cout << "? " << i + 1 << ' ' << n << endl;
        int s;
        cin >> s;
        p[i - 1] = sum - s;
        sum -= p[i - 1];
    }
    cout << "? " << 1 << ' ' << n - 1 << endl;
    int s;
    cin >> s;
    p[n - 1] = n * (n + 1) / 2 - s;
    int cnt = 0;
    rep(i, 0, n) cnt += p[i];
    p[n - 2] = n * (n + 1) / 2 - cnt;
    rep(i, 0, n) {
        cout << p[i] << ' ';
    }
    cout << endl;
}
            
            
            
        
            
Fu_L