結果
| 問題 |
No.2124 Guess the Permutation
|
| コンテスト | |
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-09-24 01:51:09 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 638 bytes |
| コンパイル時間 | 2,027 ms |
| コンパイル使用メモリ | 195,748 KB |
| 最終ジャッジ日時 | 2025-02-17 01:55:55 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 9 |
ソースコード
#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;
int main()
{
ll n, all;
cin >> n;
vector<ll> a(n);
all = n * (n+1)/2;
for (int i = 2; i <= n; i++){
ll tmp;
cout << "? " << i << " " << n << endl;
cin >> tmp;
a[i-2] = all - tmp;
all = tmp;
}
a[n-1] = all;
string delim = "";
cout << "! ";
for (auto x : a){
cout << delim << x;
delim = " ";
}
cout << endl;
}
kpinkcat