結果

問題 No.1557 Binary Variable
ユーザー mesame3993mesame3993
提出日時 2021-10-01 14:36:20
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 259 bytes
コンパイル時間 1,406 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 178,592 KB
最終ジャッジ日時 2023-09-26 06:47:01
合計ジャッジ時間 18,498 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 72 ms
71,392 KB
testcase_04 AC 406 ms
99,000 KB
testcase_05 AC 408 ms
99,388 KB
testcase_06 AC 385 ms
99,388 KB
testcase_07 AC 398 ms
99,300 KB
testcase_08 AC 475 ms
99,384 KB
testcase_09 AC 484 ms
99,024 KB
testcase_10 AC 545 ms
99,340 KB
testcase_11 AC 552 ms
99,084 KB
testcase_12 AC 465 ms
99,276 KB
testcase_13 AC 554 ms
99,408 KB
testcase_14 AC 1,002 ms
106,432 KB
testcase_15 AC 564 ms
99,792 KB
testcase_16 AC 886 ms
104,244 KB
testcase_17 AC 702 ms
101,788 KB
testcase_18 AC 655 ms
100,956 KB
testcase_19 TLE -
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