結果

問題 No.2154 あさかつの参加人数
ユーザー CleyLCleyL
提出日時 2022-12-20 23:36:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,014 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 616 ms
コンパイル使用メモリ 72,960 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-29 03:01:37
合計ジャッジ時間 22,288 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,004 ms
5,248 KB
testcase_01 AC 999 ms
5,376 KB
testcase_02 AC 1,008 ms
5,376 KB
testcase_03 AC 993 ms
5,376 KB
testcase_04 AC 1,014 ms
5,376 KB
testcase_05 AC 173 ms
5,376 KB
testcase_06 AC 559 ms
5,376 KB
testcase_07 AC 556 ms
5,376 KB
testcase_08 AC 617 ms
5,376 KB
testcase_09 AC 361 ms
5,376 KB
testcase_10 AC 518 ms
5,376 KB
testcase_11 AC 873 ms
5,376 KB
testcase_12 AC 618 ms
5,376 KB
testcase_13 AC 285 ms
5,376 KB
testcase_14 AC 618 ms
5,376 KB
testcase_15 AC 585 ms
5,376 KB
testcase_16 AC 688 ms
5,376 KB
testcase_17 AC 647 ms
5,376 KB
testcase_18 AC 782 ms
5,376 KB
testcase_19 AC 84 ms
5,376 KB
testcase_20 AC 734 ms
5,376 KB
testcase_21 AC 326 ms
5,376 KB
testcase_22 AC 632 ms
5,376 KB
testcase_23 AC 763 ms
5,376 KB
testcase_24 AC 878 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int n,m;cin>>n>>m;
  vector<int> A(n+1);
  for(int i = 0; m > i; i++){
    int x,y;cin>>x>>y;
    A[n-x]++;
    A[n-y+1]--;
  }
  int nw = 0;
  for(int i = 0; n > i; i++){
    nw += A[i];
    cout << nw << endl;
  }
}
0