結果
| 問題 |
No.1852 Divide or Reduce
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-25 22:10:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 100 ms / 2,000 ms |
| コード長 | 540 bytes |
| コンパイル時間 | 439 ms |
| コンパイル使用メモリ | 27,776 KB |
| 最終ジャッジ日時 | 2025-01-28 02:08:00 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d", &testcase_i);
| ~~~~~^~~~~~~~~~~~~~~~~~~
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d", &N);
| ~~~~~^~~~~~~~~~
main.cpp:13:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d", &A);
| ~~~~~^~~~~~~~~~
ソースコード
#include<cstdio>
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int main(){
int testcase_i;
scanf("%d", &testcase_i);
for (int ___ = 0; ___ < testcase_i; ___++){
int N;
scanf("%d", &N);
bool odd = false;
int mn = 1000000000;
for(int i = 0; i < N; ++i){
int A;
scanf("%d", &A);
chmin(mn, A);
odd ^= (A-1)&1;
}
printf(odd || ((mn-1)&1 && !(N&1)) ? "First\n" : "Second\n");
}
}