結果

問題 No.2154 あさかつの参加人数
ユーザー iseeisee
提出日時 2022-12-09 21:26:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 277 ms / 2,000 ms
コード長 407 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 80,640 KB
最終ジャッジ日時 2024-04-22 20:09:54
合計ジャッジ時間 8,941 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 263 ms
80,128 KB
testcase_01 AC 264 ms
80,176 KB
testcase_02 AC 277 ms
80,120 KB
testcase_03 AC 261 ms
80,640 KB
testcase_04 AC 262 ms
80,384 KB
testcase_05 AC 134 ms
76,416 KB
testcase_06 AC 216 ms
77,952 KB
testcase_07 AC 161 ms
78,592 KB
testcase_08 AC 153 ms
78,956 KB
testcase_09 AC 84 ms
78,516 KB
testcase_10 AC 147 ms
78,720 KB
testcase_11 AC 235 ms
80,176 KB
testcase_12 AC 194 ms
78,848 KB
testcase_13 AC 131 ms
76,956 KB
testcase_14 AC 208 ms
78,464 KB
testcase_15 AC 151 ms
78,848 KB
testcase_16 AC 201 ms
78,952 KB
testcase_17 AC 226 ms
78,320 KB
testcase_18 AC 235 ms
79,232 KB
testcase_19 AC 71 ms
76,696 KB
testcase_20 AC 202 ms
79,556 KB
testcase_21 AC 79 ms
77,952 KB
testcase_22 AC 104 ms
79,900 KB
testcase_23 AC 224 ms
79,360 KB
testcase_24 AC 244 ms
79,488 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