結果

問題 No.1557 Binary Variable
ユーザー ぷらぷら
提出日時 2021-12-11 15:23:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 3,416 ms
コンパイル使用メモリ 204,212 KB
実行使用メモリ 4,888 KB
最終ジャッジ日時 2023-09-27 03:03:37
合計ジャッジ時間 11,515 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
4,688 KB
testcase_01 AC 138 ms
4,648 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 102 ms
4,624 KB
testcase_05 AC 103 ms
4,620 KB
testcase_06 AC 96 ms
4,624 KB
testcase_07 AC 99 ms
4,616 KB
testcase_08 AC 111 ms
4,556 KB
testcase_09 AC 112 ms
4,676 KB
testcase_10 AC 122 ms
4,620 KB
testcase_11 AC 121 ms
4,720 KB
testcase_12 AC 110 ms
4,568 KB
testcase_13 AC 122 ms
4,600 KB
testcase_14 AC 132 ms
4,676 KB
testcase_15 AC 123 ms
4,712 KB
testcase_16 AC 130 ms
4,692 KB
testcase_17 AC 129 ms
4,744 KB
testcase_18 AC 128 ms
4,716 KB
testcase_19 AC 142 ms
4,716 KB
testcase_20 AC 140 ms
4,620 KB
testcase_21 AC 140 ms
4,876 KB
testcase_22 AC 141 ms
4,712 KB
testcase_23 AC 139 ms
4,624 KB
testcase_24 AC 146 ms
4,688 KB
testcase_25 AC 144 ms
4,672 KB
testcase_26 AC 149 ms
4,880 KB
testcase_27 AC 151 ms
4,616 KB
testcase_28 AC 152 ms
4,744 KB
testcase_29 AC 161 ms
4,752 KB
testcase_30 AC 159 ms
4,880 KB
testcase_31 AC 162 ms
4,716 KB
testcase_32 AC 159 ms
4,644 KB
testcase_33 AC 138 ms
4,888 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int N,M;
    cin >> N >> M;
    vector<pair<int,int>>tmp(M);
    for(int i = 0; i < M; i++) {
        cin >> tmp[i].second >> tmp[i].first;
    }
    sort(tmp.begin(),tmp.end());
    int mx = 0,sum = 0;
    for(int i = 0; i < M; i++) {
        if(mx >= tmp[i].second) {
            continue;
        }
        mx = tmp[i].first;
        sum++;
    }
    cout << N-sum << endl;
}
0