結果
問題 | No.305 鍵(2) |
ユーザー |
![]() |
提出日時 | 2017-02-04 04:20:29 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 218 ms / 2,000 ms |
コード長 | 1,093 bytes |
コンパイル時間 | 1,988 ms |
コンパイル使用メモリ | 77,248 KB |
実行使用メモリ | 71,220 KB |
平均クエリ数 | 44.08 |
最終ジャッジ日時 | 2024-07-17 00:48:23 |
合計ジャッジ時間 | 5,527 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int [] ans = new int [10]; int k=0; print(ans); String S = sc.nextLine(); if("10 unlocked".equals(S))return; String [] arr = S.split(" "); int X = Integer.parseInt(arr[0]); while(k<10){ for(int i=1; i<10; i++){ ans[k]=i; print(ans); String tmp = sc.nextLine(); String [] arrtmp = tmp.split(" "); int Y = Integer.parseInt(arrtmp[0]); if(Y==10)return; if(X<Y){ k++; X=Y; break; }else if(X>Y){ ans[k]=0; k++; break; } } } } static void print(int [] A){ for(int i=0; i<10; i++){ System.out.print(A[i]); } System.out.println(); System.out.flush(); } }