結果

問題 No.2282 Boxed Nim
ユーザー ks2mks2m
提出日時 2023-04-28 21:38:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 568 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 4,272 ms
コンパイル使用メモリ 71,408 KB
実行使用メモリ 60,848 KB
最終ジャッジ日時 2023-08-11 06:38:37
合計ジャッジ時間 12,171 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
53,696 KB
testcase_01 AC 121 ms
55,960 KB
testcase_02 AC 123 ms
55,928 KB
testcase_03 AC 125 ms
56,232 KB
testcase_04 AC 124 ms
55,352 KB
testcase_05 AC 123 ms
55,928 KB
testcase_06 AC 122 ms
55,892 KB
testcase_07 AC 123 ms
55,616 KB
testcase_08 AC 121 ms
55,816 KB
testcase_09 AC 568 ms
60,436 KB
testcase_10 AC 547 ms
60,808 KB
testcase_11 AC 567 ms
60,192 KB
testcase_12 AC 558 ms
60,584 KB
testcase_13 AC 558 ms
60,648 KB
testcase_14 AC 469 ms
60,700 KB
testcase_15 AC 472 ms
60,440 KB
testcase_16 AC 469 ms
60,228 KB
testcase_17 AC 481 ms
60,288 KB
testcase_18 AC 440 ms
60,684 KB
testcase_19 AC 563 ms
60,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();

		int x = 0;
		for (int i = 0; i < n; i++) {
			if (a[i] == 0) {
				x ^= 1;
			}
		}
		if (x == 0) {
			System.out.println("Second");
		} else {
			System.out.println("First");
		}
	}
}
0