結果
| 問題 |
No.355 数当てゲーム(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-02 13:32:12 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,170 bytes |
| コンパイル時間 | 2,267 ms |
| コンパイル使用メモリ | 84,604 KB |
| 実行使用メモリ | 73,196 KB |
| 平均クエリ数 | 1.98 |
| 最終ジャッジ日時 | 2024-07-16 09:37:00 |
| 合計ジャッジ時間 | 20,948 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 RE * 51 |
ソースコード
package yukicoder355;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int[] d={0,1,2,3};
for(int i=0;i<4;i++){;
boolean flag=false;
int memo=0;
int flagValue=-1;
for(int j=0;j<10;j++){
d[i]=j;
//重複する数字がある組み合わせを除去
for(int k=0;k<4;k++){
if(d[i]==d[k]&&i!=k)continue;
}
System.out.println(d[0]+" "+d[1]+" "+d[2]+" "+d[3]);
int aa=sc.nextInt();
int bb=sc.nextInt();
if(aa==4&bb==0){
return;
}else if(!flag){
memo=aa+bb;
flagValue=j;
flag=true;
}else if(flag){
if(memo<aa+bb){
break;
}else if(memo==aa+bb){
continue;
}else if(memo>aa+bb){
d[i]=flagValue;
break;
}
}
}
}
for(int i=0;i<4;i++){
for(int j=0;j<4;j++){
if(i==j)continue;
for(int k=0;k<4;k++){
if(i==k||j==k)continue;
for(int l=0;l<4;l++){
if(i==l||j==l||k==l)continue;
System.out.println(d[i]+" "+d[j]+" "+d[k]+" "+d[l]);
int a=sc.nextInt();
int b=sc.nextInt();
if(a==4&&b==0)return;
}
}
}
}
}
}