結果

問題 No.2154 あさかつの参加人数
ユーザー MagentorMagentor
提出日時 2022-12-09 21:29:29
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 914 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 4,734 ms
コンパイル使用メモリ 253,132 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 20:39:27
合計ジャッジ時間 22,764 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 902 ms
5,376 KB
testcase_01 AC 914 ms
5,376 KB
testcase_02 AC 878 ms
5,376 KB
testcase_03 AC 911 ms
5,376 KB
testcase_04 AC 874 ms
5,376 KB
testcase_05 AC 158 ms
5,376 KB
testcase_06 AC 498 ms
5,376 KB
testcase_07 AC 508 ms
5,376 KB
testcase_08 AC 539 ms
5,376 KB
testcase_09 AC 317 ms
5,376 KB
testcase_10 AC 457 ms
5,376 KB
testcase_11 AC 769 ms
5,376 KB
testcase_12 AC 544 ms
5,376 KB
testcase_13 AC 256 ms
5,376 KB
testcase_14 AC 551 ms
5,376 KB
testcase_15 AC 520 ms
5,376 KB
testcase_16 AC 610 ms
5,376 KB
testcase_17 AC 566 ms
5,376 KB
testcase_18 AC 680 ms
5,376 KB
testcase_19 AC 80 ms
5,376 KB
testcase_20 AC 662 ms
5,376 KB
testcase_21 AC 292 ms
5,376 KB
testcase_22 AC 580 ms
5,376 KB
testcase_23 AC 660 ms
5,376 KB
testcase_24 AC 793 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep2(i, m ,n) for (int i = (m); i < (long long)(n); i++)
#define REP(i, n) for (long long i = 1; i < (long long)(n); i++)
typedef long long ll;


int main() {
int n,m;cin>>n>>m;
  vector<int> imos(n+5,0);
  rep(i,m){
   int a,b;cin>>a>>b;
   //swap(a,b);
   imos[n-a]--;
   imos[n-b+1]++; 
  }
  int cum = 0;
  rep(i,n){
    cum += imos[i];
    cout << abs(cum) << endl;
  }
}
0