結果

問題 No.2282 Boxed Nim
ユーザー ks2mks2m
提出日時 2023-04-28 21:38:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 707 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 2,322 ms
コンパイル使用メモリ 75,080 KB
実行使用メモリ 48,708 KB
最終ジャッジ日時 2024-04-28 23:18:10
合計ジャッジ時間 11,510 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
41,120 KB
testcase_01 AC 134 ms
41,116 KB
testcase_02 AC 139 ms
41,276 KB
testcase_03 AC 140 ms
41,368 KB
testcase_04 AC 123 ms
40,424 KB
testcase_05 AC 139 ms
41,208 KB
testcase_06 AC 138 ms
41,364 KB
testcase_07 AC 137 ms
41,248 KB
testcase_08 AC 139 ms
41,488 KB
testcase_09 AC 651 ms
48,396 KB
testcase_10 AC 675 ms
48,296 KB
testcase_11 AC 688 ms
48,468 KB
testcase_12 AC 696 ms
48,148 KB
testcase_13 AC 656 ms
48,352 KB
testcase_14 AC 589 ms
48,224 KB
testcase_15 AC 608 ms
48,176 KB
testcase_16 AC 626 ms
48,384 KB
testcase_17 AC 565 ms
48,204 KB
testcase_18 AC 580 ms
48,232 KB
testcase_19 AC 707 ms
48,708 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