結果

問題 No.355 数当てゲーム(2)
ユーザー かにかに
提出日時 2017-04-01 22:40:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,347 bytes
コンパイル時間 1,413 ms
コンパイル使用メモリ 170,012 KB
実行使用メモリ 35,196 KB
平均クエリ数 1.56
最終ジャッジ日時 2023-09-24 00:56:32
合計ジャッジ時間 5,947 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
24,132 KB
testcase_01 TLE -
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 "bits/stdc++.h"
#define _CRT_SECURE_NO_WARNINGS
#define rep(i,n) for(int i = 0;i < n;i++)
#define REP(i,n,k) for(int i = n;i < k;i++)
#define P(p) cout << (p) << endl;
#define sP(p) cout << setprecision(15) << fixed << p << endl;
#define vi vector<int>
#define mp(a,b) make_pair(a,b)
using namespace std;typedef long long ll;typedef unsigned long long ull;int dx[] = { 1, -1 , 0 , 0};int dy[] = { 0,  0,  1, -1};

void solve() {
  int a,x,y,first,last;
  vi v;
  cout << 0 << " " << 1 << " " << 2 << " " << 3 << endl;
  cin >> x >> y;
  first = x + y;
  if(x + y != 4){
    REP(i,4,10){
      cout << 0 << " " << 1 << " " << 2 << " " << i << endl;
      cin >> x >> y;
      if(x + y >= first)v.push_back(i);
      if(v.size()+first == 4)break;
    }
  }
  if(v.size() != 4){
    v.push_back(0);
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
  }
  while(true){
    do{
      printf("%d %d %d %d\n",v[0],v[1],v[2],v[3]);
      cin >> x >> y;
      if(x == 4)return;
      if(x + y == 4){
	vi ne;
	ne.push_back(v[0]);
	ne.push_back(v[1]);
	ne.push_back(v[2]);
	ne.push_back(v[3]); 
	do{
	  printf("%d %d %d %d\n",ne[0],ne[1],ne[2],ne[3]);
	  cin >> x >> y;
	  if(x == 4)return;
	}while(next_permutation(ne.begin(),ne.end()));
      }
    }while(next_permutation(v.begin(),v.end()));
  }
}

int main() {
	solve();
	return 0;
}
0