結果
問題 |
No.3120 Lower Nim
|
ユーザー |
![]() |
提出日時 | 2025-04-18 22:06:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 906 bytes |
コンパイル時間 | 3,702 ms |
コンパイル使用メモリ | 251,632 KB |
実行使用メモリ | 42,256 KB |
最終ジャッジ日時 | 2025-04-18 22:07:06 |
合計ジャッジ時間 | 10,159 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | TLE * 1 -- * 42 |
ソースコード
#include <stdio.h> #include <atcoder/all> #include <bits/stdc++.h> using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001LL int main(){ int n; cin>>n; vector<int> a(n); rep(i,n)cin>>a[i]; bool f = false; rep(i,30){ int c = 0; rep(j,n){ if((a[j]>>i)&1)c ^= 1; } if(c)f = true; } if(f)cout<<"First"<<endl; else cout<<"Second"<<endl; while(true){ if(f){ rep(i,30){ int c = 0; rep(j,n){ if((a[j]>>i)&1)c ^= 1; } if(c){ rep(j,n){ if((a[j]>>i)&1){ cout<<j+1<<' '<<(1<<i)<<endl; break; } } break; } } int res; cin>>res; assert(res!=-1); if(res==1)return 0; } f = true; int i,x; cin>>i>>x; a[i-1] -= x; int res; cin>>res; assert(res!=-1); } return 0; }