結果

問題 No.1675 Strange Minimum Query
ユーザー stngstng
提出日時 2021-09-11 19:20:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 523 bytes
コンパイル時間 758 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 111,672 KB
最終ジャッジ日時 2023-09-05 07:36:54
合計ジャッジ時間 10,665 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,888 KB
testcase_01 AC 16 ms
8,060 KB
testcase_02 AC 17 ms
7,860 KB
testcase_03 AC 714 ms
46,128 KB
testcase_04 AC 645 ms
60,160 KB
testcase_05 AC 137 ms
33,500 KB
testcase_06 AC 853 ms
51,704 KB
testcase_07 AC 902 ms
59,284 KB
testcase_08 AC 16 ms
7,780 KB
testcase_09 AC 21 ms
8,576 KB
testcase_10 AC 628 ms
34,184 KB
testcase_11 AC 156 ms
20,388 KB
testcase_12 AC 701 ms
42,360 KB
testcase_13 TLE -
testcase_14 -- -
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,q = map(int,input().split())
lr = [[int(i)-1 for i in input().split()] for j in range(q)]

lr.sort(key=lambda x:x[2], reverse=True)

li = [10**9]*n
s = set(i for i in range(n))
sm = set()

for i in range(q):
    l,r,b = lr[i]
    if i > 0 and lr[i-1][2] != b:
        sm = set()
    a = set(l+i for i in range(r-l+1))
    f = False
    for i in a&s:
        f = True
        li[i] = b+1
        s.remove(i)
        sm.add(i)
    if f == False:
        if not sm&a:
            print(-1)
            exit()
    
print(*li)
0