結果

問題 No.1777 万華鏡美術館
ユーザー siro53siro53
提出日時 2021-12-06 13:22:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 559 bytes
コンパイル時間 2,277 ms
コンパイル使用メモリ 204,800 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 15:10:33
合計ジャッジ時間 2,889 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

using P = pair<int, int>;

int main() {
    int N, M;
    cin >> N >> M;
    if(M == 0) {
        cout << 5 << endl;
        return 0;
    }
    vector<P> es(M);
    for(int i=0;i<M;i++) {
        int u, v;
        cin >> u >> v;
        u--, v--;
        es[i] = {u, v};
    }
    sort(es.begin(), es.end());
    
    for(int i=0;i<M;i++) {
        auto [u, v] = es[i];
        int d = v - u;
        if(d % 2 == 0) {
            cout << 5 << endl;
            return 0;
        }
    }
    cout << 4 << endl;
}
0