結果

問題 No.2357 Guess the Function
ユーザー 沙耶花沙耶花
提出日時 2023-06-23 21:36:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,112 bytes
コンパイル時間 4,536 ms
コンパイル使用メモリ 266,444 KB
実行使用メモリ 24,360 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-13 16:35:17
合計ジャッジ時間 5,951 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,328 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 26 ms
23,928 KB
testcase_04 AC 24 ms
23,316 KB
testcase_05 AC 25 ms
23,760 KB
testcase_06 AC 24 ms
23,988 KB
testcase_07 AC 24 ms
23,304 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 26 ms
24,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001

int query(int y){
	cout<<"? "<<y<<endl;
	int r;
	cin>>r;
	return r;
}

int answer(int x,int y){
	cout<<"! "<<x<<' '<<y<<endl;
	exit(0);
}

int is_unique(int x,int y){
	map<pair<int,int>,pair<int,int>> mp;
	int c = 0;
	rep(i,101){
		for(int j=i+1;j<=100;j++){
			mp[make_pair((i+x)%j, (i+y)%j)] = make_pair(i,j);
			c++;
		}
	}
	return mp.size();
	/*
	cout<<c<<','<<mp.size()<<endl;
	if(c!=mp.size())return false;
	return true;
	*/
}

int main(){
	int x = query(1);
	int y = query(100);
	rep(i,101){
		for(int j=i+1;j<=100;j++){
			if((i+1)%j==x&&(i+100)%j==y){
				answer(i,j);
			}
		}
	}
	
	/*
	
	int t = 0;
	
	for(int i=1;i<=100;i++){
		for(int j=i+1;j<=100;j++){
			int r =is_unique(i,j);
			if(r>t){
				t = r;
				cout<<r<<','<<i<<','<<j<<endl;
			}
			
		}
	}
	*/
	/*
	int A,B;
	int t = query(1);
	if(t==0){
		
	}
	else{
		A = t-1;
		
	}
	*/
	return 0;
}
0