結果

問題 No.2044 Infinite Nim
ユーザー merlinmerlin
提出日時 2022-08-19 22:20:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 624 bytes
コンパイル時間 2,397 ms
コンパイル使用メモリ 74,308 KB
実行使用メモリ 51,044 KB
最終ジャッジ日時 2024-04-17 12:04:57
合計ジャッジ時間 8,429 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
37,256 KB
testcase_01 AC 52 ms
37,004 KB
testcase_02 AC 52 ms
37,116 KB
testcase_03 AC 53 ms
37,216 KB
testcase_04 AC 53 ms
37,160 KB
testcase_05 AC 52 ms
37,264 KB
testcase_06 AC 53 ms
37,040 KB
testcase_07 AC 53 ms
37,304 KB
testcase_08 AC 52 ms
37,036 KB
testcase_09 AC 52 ms
37,308 KB
testcase_10 AC 53 ms
37,324 KB
testcase_11 AC 54 ms
37,316 KB
testcase_12 AC 52 ms
37,228 KB
testcase_13 AC 170 ms
45,796 KB
testcase_14 AC 139 ms
42,160 KB
testcase_15 AC 125 ms
41,600 KB
testcase_16 AC 140 ms
41,932 KB
testcase_17 AC 213 ms
45,340 KB
testcase_18 AC 123 ms
41,172 KB
testcase_19 AC 126 ms
41,492 KB
testcase_20 AC 172 ms
45,860 KB
testcase_21 AC 212 ms
49,108 KB
testcase_22 AC 155 ms
45,180 KB
testcase_23 AC 131 ms
42,720 KB
testcase_24 AC 205 ms
46,236 KB
testcase_25 AC 161 ms
45,144 KB
testcase_26 AC 198 ms
45,080 KB
testcase_27 AC 120 ms
42,032 KB
testcase_28 AC 226 ms
49,056 KB
testcase_29 AC 176 ms
46,220 KB
testcase_30 AC 180 ms
46,028 KB
testcase_31 AC 215 ms
49,296 KB
testcase_32 AC 237 ms
49,220 KB
testcase_33 AC 240 ms
49,200 KB
testcase_34 AC 184 ms
49,852 KB
testcase_35 AC 238 ms
51,044 KB
testcase_36 AC 54 ms
37,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        String s[]=bu.readLine().split(" ");
        int xor=0,inf=0,i,a;
        for(i=0;i<n;i++)
        {
            a=Integer.parseInt(s[i]);
            if(a<0) inf++;
            else xor^=a;
        }

        if(xor==0 && inf%2==0) sb.append("Second");
        else sb.append("First");
        System.out.println(sb);
    }
}
0