結果

問題 No.1852 Divide or Reduce
ユーザー pockyny
提出日時 2022-02-25 22:18:19
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 615 bytes
コンパイル時間 904 ms
コンパイル使用メモリ 67,436 KB
最終ジャッジ日時 2025-01-28 02:11:04
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
int a[200010];
int main(){
    int t; cin >> t;
    while(t){
        t--;
        int i,n; cin >> n;
        for(i=0;i<n;i++) cin >> a[i];
        int mn = 1000000001;
        int c = 0;
        for(i=0;i<n;i++){
            if(!(a[i]&1)) c++;
        }
        if(c&1){
            cout << "First\n";
            continue;
        }
        for(i=0;i<n;i++) mn = min(mn,a[i]);
        int ev = 0;
        for(i=0;i<n;i++){
            a[i] -= (mn - 1);
            if(!(a[i]&1)) ev++;
        }
        if(ev&1) cout << "First\n";
        else cout << "Second\n";
    }
}
0