提出 #25600224
ソースコード 拡げる
l,q = input().split()
l = int(l)
q = int(q)
cx = [map(int, input().split()) for _ in range(q)]
c, x = [list(i) for i in zip(*cx)]
wood = []
for i in range(q):
if c[i] == 1:
wood.append(x[i])
else:
start = 0
goal = l
wood.sort()
for j in range(len(wood)):
tmp = wood[j]
if tmp < x[i]:
start = tmp
if x[i] < tmp:
goal = tmp
break
print(goal - start)
提出情報
| 提出日時 | |
|---|---|
| 問題 | D - Cutting Woods |
| ユーザ | hmsket |
| 言語 | Python (3.8.2) |
| 得点 | 0 |
| コード長 | 511 Byte |
| 結果 | TLE |
| 実行時間 | 2208 ms |
| メモリ | 97692 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 400 | ||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_max_random_00.txt, 01_max_random_01.txt, 01_max_random_02.txt, 01_max_random_03.txt, 01_max_random_04.txt, 02_all_1_00.txt, 03_all_2_00.txt, 04_hack_00.txt, 04_hack_01.txt, 04_hack_02.txt, 04_hack_03.txt, 04_hack_04.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 18 ms | 8920 KiB |
| 00_sample_01.txt | AC | 18 ms | 8920 KiB |
| 00_sample_02.txt | AC | 16 ms | 9156 KiB |
| 01_max_random_00.txt | TLE | 2208 ms | 97376 KiB |
| 01_max_random_01.txt | TLE | 2208 ms | 97684 KiB |
| 01_max_random_02.txt | TLE | 2208 ms | 97692 KiB |
| 01_max_random_03.txt | TLE | 2208 ms | 97536 KiB |
| 01_max_random_04.txt | TLE | 2208 ms | 97552 KiB |
| 02_all_1_00.txt | AC | 660 ms | 97540 KiB |
| 03_all_2_00.txt | AC | 769 ms | 97552 KiB |
| 04_hack_00.txt | TLE | 2208 ms | 97540 KiB |
| 04_hack_01.txt | AC | 1562 ms | 97376 KiB |
| 04_hack_02.txt | TLE | 2208 ms | 97372 KiB |
| 04_hack_03.txt | TLE | 2208 ms | 97376 KiB |
| 04_hack_04.txt | TLE | 2208 ms | 97544 KiB |