結果
| 問題 |
No.2154 あさかつの参加人数
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2022-12-10 16:44:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 161 ms / 2,000 ms |
| コード長 | 563 bytes |
| コンパイル時間 | 292 ms |
| コンパイル使用メモリ | 40,236 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 23:47:00 |
| 合計ジャッジ時間 | 7,100 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 2154.cc: No.2154 あさかつの参加人数 - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 500000;
/* typedef */
/* global variables */
int cs[MAX_N + 1];
/* subroutines */
/* main */
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; i < m; i++) {
int li, ri;
scanf("%d%d", &li, &ri), ri--;
cs[n - li]++, cs[n - ri]--;
}
for (int i = 0; i < n; i++) {
printf("%d\n", cs[i]);
cs[i + 1] += cs[i];
}
return 0;
}
tnakao0123