結果

問題 No.2154 あさかつの参加人数
ユーザー yukster714yukster714
提出日時 2023-05-06 14:26:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 939 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 545 ms
コンパイル使用メモリ 70,736 KB
実行使用メモリ 5,036 KB
最終ジャッジ日時 2023-08-15 14:40:05
合計ジャッジ時間 20,931 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 926 ms
5,036 KB
testcase_01 AC 939 ms
4,828 KB
testcase_02 AC 938 ms
4,868 KB
testcase_03 AC 924 ms
5,036 KB
testcase_04 AC 935 ms
4,868 KB
testcase_05 AC 156 ms
4,384 KB
testcase_06 AC 510 ms
4,384 KB
testcase_07 AC 542 ms
4,488 KB
testcase_08 AC 593 ms
4,484 KB
testcase_09 AC 344 ms
4,380 KB
testcase_10 AC 479 ms
4,380 KB
testcase_11 AC 813 ms
4,856 KB
testcase_12 AC 572 ms
4,436 KB
testcase_13 AC 258 ms
4,376 KB
testcase_14 AC 573 ms
4,380 KB
testcase_15 AC 548 ms
4,380 KB
testcase_16 AC 640 ms
4,508 KB
testcase_17 AC 591 ms
4,376 KB
testcase_18 AC 722 ms
4,424 KB
testcase_19 AC 81 ms
4,376 KB
testcase_20 AC 658 ms
4,556 KB
testcase_21 AC 309 ms
4,380 KB
testcase_22 AC 618 ms
4,876 KB
testcase_23 AC 744 ms
4,384 KB
testcase_24 AC 805 ms
4,636 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];
    }
    for(int i=0;i<n;i++){
    	cout<<a[i]<<endl;
    }
    return 0;
}
0