結果

問題 No.2154 あさかつの参加人数
ユーザー yukster714
提出日時 2023-05-06 14:28:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,017 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 71,296 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 22:17:33
合計ジャッジ時間 22,008 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

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