結果

問題 No.2154 あさかつの参加人数
ユーザー 👑 potato167potato167
提出日時 2022-12-10 00:17:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 392 ms / 2,000 ms
コード長 498 bytes
コンパイル時間 2,091 ms
コンパイル使用メモリ 195,900 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 23:23:55
合計ジャッジ時間 11,955 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 324 ms
5,248 KB
testcase_01 AC 337 ms
5,376 KB
testcase_02 AC 333 ms
5,376 KB
testcase_03 AC 392 ms
5,376 KB
testcase_04 AC 336 ms
5,376 KB
testcase_05 AC 157 ms
5,376 KB
testcase_06 AC 273 ms
5,376 KB
testcase_07 AC 161 ms
5,376 KB
testcase_08 AC 142 ms
5,376 KB
testcase_09 AC 36 ms
5,376 KB
testcase_10 AC 141 ms
5,376 KB
testcase_11 AC 285 ms
5,376 KB
testcase_12 AC 224 ms
5,376 KB
testcase_13 AC 137 ms
5,376 KB
testcase_14 AC 246 ms
5,376 KB
testcase_15 AC 144 ms
5,376 KB
testcase_16 AC 233 ms
5,376 KB
testcase_17 AC 270 ms
5,376 KB
testcase_18 AC 292 ms
5,376 KB
testcase_19 AC 17 ms
5,376 KB
testcase_20 AC 220 ms
5,376 KB
testcase_21 AC 34 ms
5,376 KB
testcase_22 AC 57 ms
5,376 KB
testcase_23 AC 263 ms
5,376 KB
testcase_24 AC 293 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
using ll = long long;
template<class T> bool chmin(T &a,const T b){if(a>b){a=b;return 1;}return 0;}
template<class T> bool chmax(T &a,const T b){if(a<b){a=b;return 1;}return 0;}
const int INF = (1<<30)-1;
#define all(p) p.begin(),p.end()

int main(){
	int N,M;
	cin>>N>>M;
	vector<int> p(N+1);
	rep(i,0,M){
		int a,b;
		cin>>a>>b;
		p[N-a]++;
		p[N+1-b]--;
	}
	rep(i,0,N){
		cout<<p[i]<<"\n";
		p[i+1]+=p[i];
	}
}
0