結果

問題 No.1285 ゴミ捨て
ユーザー tadanoningentadanoningen
提出日時 2020-11-13 22:43:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 65,948 KB
最終ジャッジ日時 2025-01-15 23:42:20
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 10 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

using namespace std;

int main(){
    int n;
    cin >> n;
    bool odd = false;
    bool even = false;
    bool plus1 = false;
    int memo = 0;
    for(int i=0;i < n;i++){
        int a; cin >> a;
        if(memo - a == 1 || memo - a == -1) plus1 = true;
        if(a % 2 == 0) even = true;
        else odd = true;
    }
    if(n == 1) cout << 1 << endl;
    else{
        if(odd && even && plus1) cout << 2 << endl;
        else cout << 1 << endl;
    }
    return 0;
}
0