結果

問題 No.1852 Divide or Reduce
ユーザー %20
提出日時 2022-02-27 00:27:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 589 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 2,588 ms
コンパイル使用メモリ 192,364 KB
最終ジャッジ日時 2025-01-28 03:35:14
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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