結果

問題 No.355 数当てゲーム(2)
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2016-05-25 21:14:46
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,403 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 79,680 KB
実行使用メモリ 35,404 KB
最終ジャッジ日時 2023-09-23 23:55:20
合計ジャッジ時間 7,530 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)

int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, 1, -1, 0};

void find(int a, int b, int c, int d){
	vector<int> vc(4);
	vc[0] = a;
	vc[1] = b;
	vc[2] = c;
	vc[3] = d;
	sort(all(vc));
	
	do{
		rep(i, 4){
			//クエリ出力
			printf("%d\n", vc[i]);

			//応答受けとり
			int x, y;
			scanf("%d %d", &x, &y);

			if (x == 4 && y == 0){
				rep(i, 4)
					printf("%d\n", vc[i]);
				return;
			}
		}
	}while(next_permutation(all(vc)));

	return;
}


int main(void){

	rep(i, 10){
		rep(j, 10){
			rep(k, 10){
				rep(l, 10){
					if (i != j && j != k && k != l && l != i)
					{
						printf("%d\n", i);
						printf("%d\n", j);
						printf("%d\n", k);
						printf("%d\n", l);
						int x, y;
						scanf("%d %d", &x, &y);

						if (x + y == 4)
						{
							find(i, j, k, l);
							return 0;
						}
					}
				}
			}
		}
	}

	return 0;
}
0