結果

問題 No.1852 Divide or Reduce
ユーザー %20%20
提出日時 2022-02-27 00:27:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 485 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 2,204 ms
コンパイル使用メモリ 199,192 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-18 05:27:18
合計ジャッジ時間 9,572 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 211 ms
4,376 KB
testcase_02 AC 211 ms
4,380 KB
testcase_03 AC 210 ms
4,376 KB
testcase_04 AC 210 ms
4,376 KB
testcase_05 AC 208 ms
4,376 KB
testcase_06 AC 178 ms
4,380 KB
testcase_07 AC 180 ms
4,376 KB
testcase_08 AC 179 ms
4,376 KB
testcase_09 AC 179 ms
4,376 KB
testcase_10 AC 181 ms
4,384 KB
testcase_11 AC 180 ms
4,376 KB
testcase_12 AC 182 ms
4,380 KB
testcase_13 AC 181 ms
4,376 KB
testcase_14 AC 179 ms
4,376 KB
testcase_15 AC 179 ms
4,376 KB
testcase_16 AC 471 ms
4,376 KB
testcase_17 AC 472 ms
4,376 KB
testcase_18 AC 484 ms
4,380 KB
testcase_19 AC 352 ms
4,376 KB
testcase_20 AC 485 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
	int Q;cin>>Q;
	for(int q=0;q<Q;++q){
		int N;cin>>N;
		int g=0,m=1e9;
		bool G=false;
		for(int i=0;i<N;++i){
			int A;cin>>A;
			g^=A%2^1;
			m=min(m,A);
		}
		if(g){
			G=true;
		}else if(N%2){
			G=false;
		}else{
			G=m%2==0;
		}
		cout<<(G?"First":"Second")<<"\n";
	}
	return 0;
}
0