結果

問題 No.2124 Guess the Permutation
ユーザー 乾麺乾麺
提出日時 2024-04-03 20:59:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 870 bytes
コンパイル時間 2,149 ms
コンパイル使用メモリ 189,800 KB
実行使用メモリ 38,548 KB
最終ジャッジ日時 2024-04-03 20:59:51
合計ジャッジ時間 9,222 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;i++)
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using si =vector<char>;
using ssi =vector<si>;
//using mint = modint998244353;
const long long INF = 1e18;
//bit全探索 rep(i,0,1<<(n-1)){rep(j,0,n-1)if(I&(1<<j))}
//int a = s[0] - ‘0’;文字列から数字
//int a=atoi(s.c_str());
//“ABCDEFGHIJKLMNOPQRSTUVWXYZ"
//ll l-=-1,r=2e9;
//while (r - l > 1) {
//    ll m = (l + r) / 2;
//    (m * (m + 1) / 2 <= n + 1 ? l : r) = m;
//  }
int main(){ int n;
cin>>n;vi vec(n+1);
int sum=n*(n+1)/2;
rep(i,0,n-1){
	cout<<"? "<<i+2<<" "<<n;
	int a;
	cin>>a;
	vec[i]=sum-a;
	sum-=a;
}
cout<<"!";
rep(i,0,n){
	cout<<" "<<vec[i];
}
}
0