結果

問題 No.2252 Find Zero
ユーザー achapiachapi
提出日時 2023-03-24 21:56:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,286 bytes
コンパイル時間 4,430 ms
コンパイル使用メモリ 270,548 KB
実行使用メモリ 24,504 KB
平均クエリ数 195.33
最終ジャッジ日時 2023-10-18 21:01:52
合計ジャッジ時間 6,902 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 82 ms
24,504 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 54 ms
24,504 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 52 ms
24,504 KB
testcase_11 AC 52 ms
24,504 KB
testcase_12 AC 53 ms
24,504 KB
testcase_13 AC 52 ms
24,504 KB
testcase_14 AC 53 ms
24,504 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//using mint = modint998244353;
//using mint = modint1000000007;
#define all(...) begin(__VA_ARGS__), end(__VA_ARGS__)
#ifdef LOCAL
#  include <debug_print.hpp>
#  define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#  define debug(...) (static_cast<void>(0))
#endif
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
//using Graph=vector<vector<int>>;
/*
struct Edge{int to;ll cost;};
using Graph=vector<vector<Edge>>;
using Pair=pair<ll,int>;
*/
const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

int main() {
	int n;cin>>n;
	map<int,int> m;
	for(int i=0;i<n;i++){
		vector<int> a(n);
		vector<int> b(n);
		for(int j=0;j<n;j++){
			a[(i+j)%n]=j;
			b[j]=(i+j)%n;
		}
		int p=0;
		for(int i=0;i<n-1;i+=2){
			p+=b[(a[i]+a[i+1])%n];
		}
		m[p]=i;
	}
	int x=0;
	for(int i=0;i<n-1;i+=2){
		cout<<"? "<<i<<" "<<i+1<<endl;
		int c;cin>>c;
		x+=c;
	}
	cout<<"! "<<m[x]<<endl;
}
0