結果

問題 No.2154 あさかつの参加人数
ユーザー yukster714yukster714
提出日時 2023-05-06 14:28:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 959 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 1,176 ms
コンパイル使用メモリ 70,816 KB
実行使用メモリ 4,940 KB
最終ジャッジ日時 2023-08-15 14:42:41
合計ジャッジ時間 21,423 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 941 ms
4,912 KB
testcase_01 AC 933 ms
4,840 KB
testcase_02 AC 946 ms
4,940 KB
testcase_03 AC 952 ms
4,848 KB
testcase_04 AC 959 ms
4,848 KB
testcase_05 AC 157 ms
4,380 KB
testcase_06 AC 519 ms
4,376 KB
testcase_07 AC 544 ms
4,468 KB
testcase_08 AC 601 ms
4,376 KB
testcase_09 AC 352 ms
4,376 KB
testcase_10 AC 483 ms
4,380 KB
testcase_11 AC 830 ms
4,796 KB
testcase_12 AC 584 ms
4,376 KB
testcase_13 AC 266 ms
4,380 KB
testcase_14 AC 578 ms
4,376 KB
testcase_15 AC 571 ms
4,376 KB
testcase_16 AC 648 ms
4,376 KB
testcase_17 AC 606 ms
4,380 KB
testcase_18 AC 734 ms
4,376 KB
testcase_19 AC 83 ms
4,380 KB
testcase_20 AC 685 ms
4,528 KB
testcase_21 AC 312 ms
4,376 KB
testcase_22 AC 618 ms
4,916 KB
testcase_23 AC 730 ms
4,744 KB
testcase_24 AC 826 ms
4,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int n,m; cin>>n>>m;
    vector<int>a(n);
    for(int i=0;i<m;i++){
    	int l,r;cin>>l>>r;
		a[n-l]++;
		a[n-r+1]--;
    }
    for(int i=0;i<n;i++){
    	if(i>0) a[i]+=a[i-1];
    	cout<<a[i]<<endl;
    }
    return 0;
}
0