結果

問題 No.1557 Binary Variable
ユーザー chocoruskchocorusk
提出日時 2021-06-25 21:26:21
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 964 bytes
コンパイル時間 3,743 ms
コンパイル使用メモリ 191,192 KB
実行使用メモリ 4,988 KB
最終ジャッジ日時 2023-09-07 14:01:46
合計ジャッジ時間 10,224 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
4,640 KB
testcase_01 AC 134 ms
4,756 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 104 ms
4,624 KB
testcase_05 AC 103 ms
4,740 KB
testcase_06 AC 98 ms
4,680 KB
testcase_07 AC 101 ms
4,748 KB
testcase_08 AC 113 ms
4,736 KB
testcase_09 AC 115 ms
4,676 KB
testcase_10 AC 124 ms
4,648 KB
testcase_11 AC 124 ms
4,736 KB
testcase_12 AC 113 ms
4,688 KB
testcase_13 AC 125 ms
4,688 KB
testcase_14 AC 134 ms
4,640 KB
testcase_15 AC 125 ms
4,748 KB
testcase_16 AC 134 ms
4,988 KB
testcase_17 AC 132 ms
4,800 KB
testcase_18 AC 131 ms
4,804 KB
testcase_19 AC 144 ms
4,688 KB
testcase_20 AC 143 ms
4,684 KB
testcase_21 AC 141 ms
4,756 KB
testcase_22 AC 144 ms
4,680 KB
testcase_23 AC 143 ms
4,692 KB
testcase_24 AC 148 ms
4,640 KB
testcase_25 AC 147 ms
4,632 KB
testcase_26 AC 151 ms
4,736 KB
testcase_27 AC 153 ms
4,692 KB
testcase_28 AC 155 ms
4,688 KB
testcase_29 AC 163 ms
4,692 KB
testcase_30 AC 160 ms
4,800 KB
testcase_31 AC 164 ms
4,644 KB
testcase_32 AC 162 ms
4,684 KB
testcase_33 AC 141 ms
4,984 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;

int main()
{
    ll n;int m; cin>>n>>m;
    vector<P> v(m);
    for(int i=0; i<m; i++){
        cin>>v[i].second>>v[i].first;
    }
    ll ans=0;
    sort(v.begin(), v.end());
    int pr=-1;
    for(int i=0; i<m; i++){
        if(pr<v[i].second){
            pr=v[i].first;
            ans++;
        }
    }
    ans=n-ans;
    cout<<ans<<endl;
    return 0;
}


0