結果
問題 |
No.2044 Infinite Nim
|
ユーザー |
![]() |
提出日時 | 2022-08-19 22:14:20 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 610 bytes |
コンパイル時間 | 2,223 ms |
コンパイル使用メモリ | 74,880 KB |
実行使用メモリ | 60,836 KB |
最終ジャッジ日時 | 2024-10-08 09:02:53 |
合計ジャッジ時間 | 8,324 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 WA * 8 |
ソースコード
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) a=2; else xor^=a; } if(xor==0) sb.append("Second"); else sb.append("First"); System.out.println(sb); } }