結果
問題 | No.24 数当てゲーム |
ユーザー |
|
提出日時 | 2015-09-22 23:10:17 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 130 ms / 5,000 ms |
コード長 | 765 bytes |
コンパイル時間 | 5,812 ms |
コンパイル使用メモリ | 75,152 KB |
実行使用メモリ | 54,248 KB |
最終ジャッジ日時 | 2024-07-19 08:42:17 |
合計ジャッジ時間 | 6,361 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
import java.util.Scanner;public class Main_yukicoder24 {public static void main(String[] args) {Scanner sc = new Scanner(System.in);int n = sc.nextInt();int[] abcd = new int[10];int y = 0;for (int i = 0; i < n; i++) {int[] tmp = new int[4];for (int j = 0; j < 4; j++) {tmp[j] = sc.nextInt();}int d;if (sc.next().equals("YES")) {d = 1;y++;} else {d = -1;}for (int j = 0; j < 4; j++) {abcd[tmp[j]] += d;}}for (int i = 0; i < 10; i++) {if (y == abcd[i]) {System.out.println(i);}}sc.close();}}