結果

問題 No.2154 あさかつの参加人数
ユーザー iseeisee
提出日時 2022-12-09 21:26:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 273 ms / 2,000 ms
コード長 407 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 81,572 KB
最終ジャッジ日時 2023-08-04 21:50:46
合計ジャッジ時間 9,352 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 273 ms
81,468 KB
testcase_01 AC 248 ms
81,464 KB
testcase_02 AC 259 ms
81,572 KB
testcase_03 AC 249 ms
81,220 KB
testcase_04 AC 255 ms
81,372 KB
testcase_05 AC 159 ms
77,304 KB
testcase_06 AC 215 ms
78,988 KB
testcase_07 AC 169 ms
79,940 KB
testcase_08 AC 156 ms
80,384 KB
testcase_09 AC 108 ms
79,616 KB
testcase_10 AC 158 ms
79,764 KB
testcase_11 AC 233 ms
81,456 KB
testcase_12 AC 199 ms
79,692 KB
testcase_13 AC 151 ms
78,524 KB
testcase_14 AC 214 ms
79,700 KB
testcase_15 AC 164 ms
80,216 KB
testcase_16 AC 202 ms
80,104 KB
testcase_17 AC 228 ms
79,548 KB
testcase_18 AC 235 ms
80,484 KB
testcase_19 AC 98 ms
77,712 KB
testcase_20 AC 196 ms
80,636 KB
testcase_21 AC 102 ms
79,096 KB
testcase_22 AC 119 ms
80,948 KB
testcase_23 AC 219 ms
80,364 KB
testcase_24 AC 235 ms
81,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    # 入力
    N, M = map(int, input().split())
    # 計算・出力
    S = [0]*(N+1)
    for _ in range(M):
        L, R = map(int, input().split())
        S[R-1] += 1
        S[L] -= 1
    for i in range(N):
        S[i+1] += S[i]
    S.pop()
    for ans in reversed(S):
        print(ans)

if __name__ == "__main__":
    main()
0