結果

問題 No.355 数当てゲーム(2)
ユーザー rapurasurapurasu
提出日時 2016-08-21 08:37:01
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 1,529 bytes
コンパイル時間 1,159 ms
コンパイル使用メモリ 146,472 KB
実行使用メモリ 24,372 KB
平均クエリ数 22.08
最終ジャッジ日時 2023-09-24 00:28:00
合計ジャッジ時間 5,206 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
int check[11];
int num[4];
int c[11];
int main(){
        REP(i,10){
            int x,y;
            cout<<(i)%10<<" "<<(i+1)%10<<" "<<(i+2)%10<<" "<<(i+3)%10<<endl;
            cin>>x>>y;
            if(x==4&&y==0)return 0;
            check[(i)%10]=x+y;
        }
	int count=0;
	REP(i,10){
	    REP(j,10){
	        REP(k,10){
	           REP(l,10){
	               if(i==j||i==k||j==k||i==l||j==l||k==l)continue;
	               REP(s,10)c[s]=0;
	               c[i]++;c[j]++;c[k]++;c[l]++;
	               bool cc=true;;
	               REP(s,10){
	                   if(check[s]!=c[s%10]+c[(s+1)%10]+c[(s+2)%10]+c[(s+3)%10]){
                              cc=false;
                           }
	               }
	               if(cc){
	                  num[0]=i;
	                  num[1]=j;
	                  num[2]=k;
                          num[3]=l;
	               }
	           }
	        }
	    }
	}
	//全列挙
	REP(i,4){
	   REP(j,4){
	       if(i==j)continue;
	       REP(k,4){
	          if(i==k||j==k)continue;
	          REP(l,4){
	             if(i==l||j==l||k==l)continue;
	             cout<<num[i]<<" "<<num[j]<<" "<<num[k]<<" "<<num[l]<<endl;
	             int x,y;
	             cin>>x>>y;
	             if(x==4&&y==0)return 0;
	          }
	       }
	   }
	}
	return(0);
}
0