結果

問題 No.1557 Binary Variable
ユーザー yunix91201367yunix91201367
提出日時 2021-06-25 21:48:47
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 636 bytes
コンパイル時間 2,253 ms
コンパイル使用メモリ 172,572 KB
実行使用メモリ 9,580 KB
最終ジャッジ日時 2023-09-07 14:27:05
合計ジャッジ時間 7,964 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
9,424 KB
testcase_01 AC 135 ms
9,388 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 105 ms
9,340 KB
testcase_05 AC 101 ms
9,484 KB
testcase_06 AC 98 ms
9,332 KB
testcase_07 AC 100 ms
9,308 KB
testcase_08 AC 109 ms
9,240 KB
testcase_09 AC 109 ms
9,484 KB
testcase_10 AC 119 ms
9,436 KB
testcase_11 AC 118 ms
9,308 KB
testcase_12 AC 106 ms
9,388 KB
testcase_13 AC 121 ms
9,312 KB
testcase_14 AC 125 ms
9,264 KB
testcase_15 AC 120 ms
9,580 KB
testcase_16 AC 128 ms
9,324 KB
testcase_17 AC 129 ms
9,388 KB
testcase_18 AC 130 ms
9,368 KB
testcase_19 AC 138 ms
9,244 KB
testcase_20 AC 139 ms
9,264 KB
testcase_21 AC 140 ms
9,312 KB
testcase_22 AC 141 ms
9,376 KB
testcase_23 AC 139 ms
9,308 KB
testcase_24 AC 145 ms
9,432 KB
testcase_25 AC 140 ms
9,328 KB
testcase_26 AC 143 ms
9,272 KB
testcase_27 AC 148 ms
9,520 KB
testcase_28 AC 148 ms
9,416 KB
testcase_29 AC 159 ms
9,368 KB
testcase_30 AC 158 ms
9,432 KB
testcase_31 AC 163 ms
9,360 KB
testcase_32 AC 162 ms
9,428 KB
testcase_33 AC 141 ms
9,384 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 2 ms
4,384 KB
testcase_36 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
using vec_int = vector<int>;
using P = pair<int,int>;
using T = tuple<int,int,int>;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

signed main(){
    int N, M; cin>>N>>M;
    vec_int L(M), R(M);
    rep(i,M)cin>>L.at(i)>>R.at(i);
    vector<P> RL(M);
    rep(i,M)RL.at(i) = make_pair(R.at(i), L.at(i));
    sort(RL.begin(), RL.end());
    int zeros = 0;
    int right = 0;
    rep(i,M){
        if(RL.at(i).second>right){
            right = RL.at(i).first;
            zeros++;
        }
    }
    cout<<N-zeros<<endl;





    return 0;
}
0