結果
問題 | No.1675 Strange Minimum Query |
ユーザー | stng |
提出日時 | 2021-09-11 19:19:59 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 523 bytes |
コンパイル時間 | 814 ms |
コンパイル使用メモリ | 86,688 KB |
実行使用メモリ | 297,888 KB |
最終ジャッジ日時 | 2023-09-05 07:35:49 |
合計ジャッジ時間 | 9,924 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 74 ms
75,668 KB |
testcase_01 | AC | 74 ms
71,344 KB |
testcase_02 | AC | 74 ms
71,196 KB |
testcase_03 | AC | 453 ms
101,512 KB |
testcase_04 | AC | 469 ms
152,336 KB |
testcase_05 | AC | 189 ms
119,404 KB |
testcase_06 | AC | 504 ms
101,108 KB |
testcase_07 | AC | 573 ms
129,036 KB |
testcase_08 | AC | 73 ms
71,164 KB |
testcase_09 | AC | 105 ms
76,980 KB |
testcase_10 | AC | 379 ms
109,104 KB |
testcase_11 | AC | 183 ms
99,328 KB |
testcase_12 | AC | 408 ms
112,300 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 | -- | - |
ソースコード
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)