結果

問題 No.2154 あさかつの参加人数
ユーザー kotamanegikotamanegi
提出日時 2022-12-02 21:47:53
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 881 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 2,528 ms
コンパイル使用メモリ 160,956 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-18 05:39:38
合計ジャッジ時間 22,365 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 851 ms
5,376 KB
testcase_01 AC 839 ms
5,376 KB
testcase_02 AC 862 ms
5,376 KB
testcase_03 AC 881 ms
5,376 KB
testcase_04 AC 867 ms
5,376 KB
testcase_05 AC 151 ms
5,376 KB
testcase_06 AC 488 ms
5,376 KB
testcase_07 AC 498 ms
5,376 KB
testcase_08 AC 541 ms
5,376 KB
testcase_09 AC 325 ms
5,376 KB
testcase_10 AC 465 ms
5,376 KB
testcase_11 AC 762 ms
5,376 KB
testcase_12 AC 559 ms
5,376 KB
testcase_13 AC 247 ms
5,376 KB
testcase_14 AC 538 ms
5,376 KB
testcase_15 AC 534 ms
5,376 KB
testcase_16 AC 575 ms
5,376 KB
testcase_17 AC 556 ms
5,376 KB
testcase_18 AC 671 ms
5,376 KB
testcase_19 AC 73 ms
5,376 KB
testcase_20 AC 620 ms
5,376 KB
testcase_21 AC 298 ms
5,376 KB
testcase_22 AC 533 ms
5,376 KB
testcase_23 AC 645 ms
5,376 KB
testcase_24 AC 749 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
int ans[600000];
int main(){
  int n,m;
  cin >> n >> m;
  for(int i = 0;i < m;++i){
  	int a,b;
    cin >> a >> b;
    ans[n - a] += 1;
    ans[n - b + 1] -= 1;
  }
  for(int i = 0;i < n;++i){
  	ans[i+1] += ans[i];
    cout << ans[i] << endl;
  }
}
0