結果

問題 No.1852 Divide or Reduce
ユーザー pockynypockyny
提出日時 2022-02-25 22:18:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 615 bytes
コンパイル時間 476 ms
コンパイル使用メモリ 69,736 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-16 17:20:24
合計ジャッジ時間 7,502 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 373 ms
4,376 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

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