結果
問題 | No.24 数当てゲーム |
ユーザー |
|
提出日時 | 2017-10-11 01:32:13 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,100 bytes |
コンパイル時間 | 3,669 ms |
コンパイル使用メモリ | 77,704 KB |
実行使用メモリ | 50,548 KB |
最終ジャッジ日時 | 2024-11-17 08:42:04 |
合計ジャッジ時間 | 5,215 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 5 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No24{ public static void main(String[] args) { try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int turn = Integer.parseInt(br.readLine()); kazuate(br, turn); } catch(IOException e){ e.getStackTrace(); } catch(NumberFormatException e){ e.getStackTrace(); } } public static void kazuate(BufferedReader br, int n) throws IOException, NumberFormatException{ int[] jiroThought = new int[10]; int[] taroSuggest = new int[4]; for(int i=0; i < n; i++){ String[] str = br.readLine().split(" "); for(int j=0; j < 4; j++) taroSuggest[j] = Integer.parseInt(str[j]); for(int k=0; k < 4; k++){ if(str[4].equals("YES")) jiroThought[taroSuggest[k]]++; else if (str[4].equals("NO")) jiroThought[taroSuggest[k]]--; } } System.out.println(getIndex(jiroThought)); } public static int getIndex(int[] a){ int ans = a[0]; for(int i=0; i < a.length; i++){ if(a[i] > ans) ans = i; } return ans; } }