結果

問題 No.2154 あさかつの参加人数
ユーザー nao109nao109
提出日時 2022-12-13 21:50:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 893 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 2,519 ms
コンパイル使用メモリ 194,436 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 05:44:22
合計ジャッジ時間 22,754 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 883 ms
5,248 KB
testcase_01 AC 863 ms
5,376 KB
testcase_02 AC 893 ms
5,376 KB
testcase_03 AC 884 ms
5,376 KB
testcase_04 AC 876 ms
5,376 KB
testcase_05 AC 161 ms
5,376 KB
testcase_06 AC 501 ms
5,376 KB
testcase_07 AC 496 ms
5,376 KB
testcase_08 AC 557 ms
5,376 KB
testcase_09 AC 311 ms
5,376 KB
testcase_10 AC 451 ms
5,376 KB
testcase_11 AC 779 ms
5,376 KB
testcase_12 AC 531 ms
5,376 KB
testcase_13 AC 255 ms
5,376 KB
testcase_14 AC 562 ms
5,376 KB
testcase_15 AC 516 ms
5,376 KB
testcase_16 AC 592 ms
5,376 KB
testcase_17 AC 565 ms
5,376 KB
testcase_18 AC 675 ms
5,376 KB
testcase_19 AC 78 ms
5,376 KB
testcase_20 AC 622 ms
5,376 KB
testcase_21 AC 297 ms
5,376 KB
testcase_22 AC 548 ms
5,376 KB
testcase_23 AC 668 ms
5,376 KB
testcase_24 AC 773 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define all(a) a.begin(),a.end()
int main(){
  int n,m;
  cin >> n >> m;
  vector<int> day(n);
  for(int i=0; i<m; ++i){
    int l,r;
    cin >> l >> r;
    day[n-l]++;
    day[n-r+1]--;
  }
  
  int cnt=0;
  for(int i=0; i<n; ++i){
    cnt+=day[i];
    cout << cnt << endl;
  }
  return 0;
}
0