結果

問題 No.1675 Strange Minimum Query
ユーザー TsubajiroTsubajiro
提出日時 2022-07-02 20:25:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 539 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 48,508 KB
最終ジャッジ日時 2023-08-18 12:32:40
合計ジャッジ時間 12,201 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,968 KB
testcase_01 AC 16 ms
8,252 KB
testcase_02 AC 16 ms
7,812 KB
testcase_03 AC 928 ms
41,664 KB
testcase_04 AC 787 ms
36,880 KB
testcase_05 AC 93 ms
11,040 KB
testcase_06 AC 1,125 ms
47,436 KB
testcase_07 AC 1,152 ms
48,508 KB
testcase_08 AC 17 ms
7,856 KB
testcase_09 AC 21 ms
8,424 KB
testcase_10 AC 592 ms
27,628 KB
testcase_11 AC 129 ms
12,312 KB
testcase_12 AC 667 ms
29,516 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 = list(map(int, input().split()))
B = []
ans = [0]*N
for _ in range(Q):
    l,r,b = list(map(int, input().split()))
    B.append([b,l,r])
same = set()
B.sort(reverse=True)
for i in range(Q):
    b,l,r = B[i]
    flag=False
    for j in range(l-1,r):
        if ans[j]:
            if b in same:
                flag=True
            continue
        else:
            ans[j]=b
            flag=True
    if not flag:
        print(-1)
        exit()
    same.add(b)
for i in range(N):
    if ans[i]==0:
        ans[i]=10**9
print(*ans)
0