結果

問題 No.1557 Binary Variable
ユーザー mesame3993mesame3993
提出日時 2021-10-01 14:37:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 259 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 59,352 KB
最終ジャッジ日時 2023-09-26 06:49:16
合計ジャッジ時間 19,747 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 15 ms
7,816 KB
testcase_04 AC 830 ms
48,120 KB
testcase_05 AC 831 ms
47,972 KB
testcase_06 AC 805 ms
46,936 KB
testcase_07 AC 818 ms
47,444 KB
testcase_08 AC 1,021 ms
49,540 KB
testcase_09 AC 1,086 ms
49,596 KB
testcase_10 AC 1,777 ms
49,956 KB
testcase_11 AC 1,828 ms
50,048 KB
testcase_12 AC 980 ms
49,424 KB
testcase_13 AC 1,885 ms
50,052 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
lis = [list(map(int, input().split())) for _ in range(m)]
lis.sort(key=lambda x:x[1])
B = [1] * n
for i in range(m):
	for j in range(lis[i][0]-1, lis[i][-1]):
		if B[j] == 0:
			break
	else:
		B[lis[i][-1]-1] = 0
print(sum(B))
0