結果

問題 No.1557 Binary Variable
ユーザー the-xinthe-xin
提出日時 2021-07-09 20:08:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 622 ms
コンパイル使用メモリ 70,508 KB
実行使用メモリ 7,784 KB
最終ジャッジ日時 2023-09-14 06:37:57
合計ジャッジ時間 7,595 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
7,548 KB
testcase_01 AC 135 ms
7,564 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 93 ms
7,468 KB
testcase_05 AC 93 ms
7,544 KB
testcase_06 AC 90 ms
7,472 KB
testcase_07 AC 91 ms
7,580 KB
testcase_08 AC 105 ms
7,508 KB
testcase_09 AC 105 ms
7,440 KB
testcase_10 AC 118 ms
7,540 KB
testcase_11 AC 118 ms
7,544 KB
testcase_12 AC 103 ms
7,448 KB
testcase_13 AC 118 ms
7,564 KB
testcase_14 AC 134 ms
7,764 KB
testcase_15 AC 119 ms
7,440 KB
testcase_16 AC 131 ms
7,544 KB
testcase_17 AC 131 ms
7,568 KB
testcase_18 AC 128 ms
7,440 KB
testcase_19 AC 143 ms
7,476 KB
testcase_20 AC 143 ms
7,784 KB
testcase_21 AC 142 ms
7,536 KB
testcase_22 AC 143 ms
7,444 KB
testcase_23 AC 141 ms
7,472 KB
testcase_24 AC 148 ms
7,556 KB
testcase_25 AC 147 ms
7,724 KB
testcase_26 AC 151 ms
7,652 KB
testcase_27 AC 155 ms
7,564 KB
testcase_28 AC 157 ms
7,544 KB
testcase_29 AC 164 ms
7,584 KB
testcase_30 AC 163 ms
7,760 KB
testcase_31 AC 166 ms
7,696 KB
testcase_32 AC 161 ms
7,468 KB
testcase_33 AC 141 ms
7,568 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 1e6+10,mod=998244353;
typedef long long LL;
struct Node{
	LL l,r;
	bool operator<(const Node &a)const{
		return r<a.r;
	}
}node[N];
int main(){
	LL n,m;
	scanf("%lld%lld",&n,&m);
	for(int i=1;i<=m;i++){
		cin>>node[i].l>>node[i].r;
	}
	sort(node+1,node+1+m);
	LL ed=-2e9-10,res=0;
    for(int i=1;i<=m;i++){
        if(node[i].l>ed){
            res++;
            ed=node[i].r;
        }
    }
	cout<<n-res;
	return 0;
}
0