結果
問題 |
No.2044 Infinite Nim
|
ユーザー |
![]() |
提出日時 | 2022-08-19 22:20:55 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 225 ms / 2,000 ms |
コード長 | 624 bytes |
コンパイル時間 | 2,230 ms |
コンパイル使用メモリ | 74,720 KB |
実行使用メモリ | 60,796 KB |
最終ジャッジ日時 | 2024-10-09 06:07:38 |
合計ジャッジ時間 | 8,192 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
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); } }