結果
問題 | No.1285 ゴミ捨て |
ユーザー |
|
提出日時 | 2020-11-13 22:32:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 578 bytes |
コンパイル時間 | 465 ms |
コンパイル使用メモリ | 66,224 KB |
最終ジャッジ日時 | 2025-01-15 23:36:15 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | AC * 13 WA * 9 |
ソースコード
#include<iostream> using namespace std; int main(){ int n; cin >> n; bool odd = false; bool even = true; for(int i=0;i < n;i++){ int a; cin >> a; if(a % 2 == 0) even = true; else odd = true; } if(n == 1) cout << 1 << endl; else if(n == 2){ if(odd && even) cout << 2 << endl; else cout << 1 << endl; }else if(n == 3){ cout << 1 << endl; }else{ if(odd && even) cout << 2 << endl; else if(odd) cout << 1 << endl; else if(even) cout << 1 << endl; } return 0; }