結果

問題 No.355 数当てゲーム(2)
ユーザー 👑 kmjpkmjp
提出日時 2016-04-02 00:57:03
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,210 bytes
コンパイル時間 1,297 ms
コンパイル使用メモリ 148,880 KB
実行使用メモリ 24,396 KB
平均クエリ数 21.67
最終ジャッジ日時 2023-09-23 10:02:26
合計ジャッジ時間 5,576 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
23,640 KB
testcase_01 AC 27 ms
23,424 KB
testcase_02 AC 26 ms
24,396 KB
testcase_03 AC 26 ms
24,024 KB
testcase_04 AC 26 ms
24,036 KB
testcase_05 AC 25 ms
23,652 KB
testcase_06 AC 25 ms
23,832 KB
testcase_07 AC 25 ms
24,012 KB
testcase_08 AC 26 ms
24,264 KB
testcase_09 AC 25 ms
24,036 KB
testcase_10 AC 25 ms
23,376 KB
testcase_11 AC 25 ms
23,532 KB
testcase_12 AC 25 ms
24,024 KB
testcase_13 AC 26 ms
24,372 KB
testcase_14 AC 24 ms
23,520 KB
testcase_15 AC 26 ms
23,544 KB
testcase_16 AC 25 ms
23,640 KB
testcase_17 AC 25 ms
24,336 KB
testcase_18 AC 25 ms
24,012 KB
testcase_19 AC 25 ms
23,388 KB
testcase_20 AC 25 ms
23,676 KB
testcase_21 AC 25 ms
23,724 KB
testcase_22 AC 25 ms
24,264 KB
testcase_23 AC 24 ms
23,832 KB
testcase_24 AC 25 ms
23,388 KB
testcase_25 AC 25 ms
23,844 KB
testcase_26 AC 25 ms
23,544 KB
testcase_27 AC 25 ms
23,628 KB
testcase_28 AC 25 ms
24,000 KB
testcase_29 AC 24 ms
23,412 KB
testcase_30 AC 27 ms
24,048 KB
testcase_31 AC 25 ms
23,520 KB
testcase_32 AC 25 ms
24,036 KB
testcase_33 AC 26 ms
24,036 KB
testcase_34 AC 26 ms
24,000 KB
testcase_35 WA -
testcase_36 AC 26 ms
23,832 KB
testcase_37 AC 25 ms
24,324 KB
testcase_38 AC 25 ms
23,376 KB
testcase_39 AC 25 ms
23,652 KB
testcase_40 AC 25 ms
23,532 KB
testcase_41 AC 27 ms
23,520 KB
testcase_42 AC 24 ms
23,376 KB
testcase_43 AC 24 ms
23,364 KB
testcase_44 AC 25 ms
24,348 KB
testcase_45 AC 25 ms
23,544 KB
testcase_46 AC 25 ms
23,388 KB
testcase_47 AC 24 ms
23,376 KB
testcase_48 AC 25 ms
24,264 KB
testcase_49 AC 24 ms
23,628 KB
testcase_50 AC 26 ms
23,652 KB
testcase_51 AC 26 ms
23,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N[10];

pair<int,int> ask(int a,int b,int c,int d) {
	int x,y;
	cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
	cin>>x>>y;
	return {x,y};
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	int mi=4;
	for(i=3;i<=9;i++) {
		auto r=ask(0,1,2,i);
		N[i]=r.first+r.second;
		mi=min(mi,N[i]);
	}
	for(i=3;i<=9;i++) N[i]=N[i]-mi;
	for(i=0;i<=2;i++) {
		auto r=ask(i,7,8,9);
		N[i]=r.first+r.second-N[7]-N[8]-N[9];
	}
	vector<int> V;
	FOR(i,10) if(N[i]) V.push_back(i);
	do {
		auto r=ask(V[0],V[1],V[2],V[3]);
		if(r.first==4) return;
	} while(next_permutation(ALL(V)));
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}
0