結果

問題 No.355 数当てゲーム(2)
ユーザー nxterunxteru
提出日時 2017-04-01 00:47:40
言語 C
(gcc 12.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 854 bytes
コンパイル時間 1,023 ms
コンパイル使用メモリ 28,904 KB
実行使用メモリ 35,440 KB
最終ジャッジ日時 2023-09-24 00:56:40
合計ジャッジ時間 7,663 ms
ジャッジサーバーID
(参考情報)
judge15 / 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 <stdio.h>
#include<stdlib.h>
int w[4]={10,10,10,10};
int q(int x[4],int a,int b){
    int y,z;
   printf("%d %d %d %d",x[(a+1)%4],x[(a+2)%4],x[(a+3)%4],x[a]) ;
   scanf("%d%d",&y,&z);
   if(y==4)
   exit(0);
   
   if(y>b)
    w[a]=x[3];
       
   return y;
   
}

int main(void){
    
 
  for(int i=3;i>=0;i--){
      int a[4]={0,1,2,3};
      int z=q(a,i,4);
      a[3]=4;
      if(z>q(a,i,4))
      w[i]=3;
      a[3]=3;
      for(int j=4;j<=9;j++){
          a[3]=j;
         z= q(a,i,z);
      }
      
      if(w[i]>9){
          int b[4]={9,1,2,4};
          a[0]=9,a[3]=0;
          q(a,i,q(b,i,4));
          
          b[0]=0,b[1]=9,a[0]=0,a[1]=9,a[3]=1;
          q(a,i,q(b,i,4));
          
          b[1]=1,b[2]=9,a[1]=1,a[2]=9,a[3]=2;
          q(a,i,q(b,i,4));
      }
      
  
  } printf("%d %d %d %d",w[0],w[1],w[2],w[3]);
}

0