結果
問題 | No.2559 眩しい数直線 |
ユーザー |
|
提出日時 | 2023-12-02 14:39:23 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 77 ms / 2,000 ms |
コード長 | 843 bytes |
コンパイル時間 | 261 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 76,588 KB |
最終ジャッジ日時 | 2024-09-26 17:03:55 |
合計ジャッジ時間 | 2,364 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
import sys,math#if len(sys.argv)==2:sys.stdin=open(sys.argv[1])from collections import defaultdict,dequefrom itertools import combinations,permutations,accumulate,productfrom bisect import bisect,bisect_left,bisect_rightfrom heapq import heappop,heappush,heapify#from sortedcontainers import SortedList,SortedSetdef input(): return sys.stdin.readline().rstrip()def ii(): return int(input())def ms(): return map(int, input().split())def li(): return list(map(int,input().split()))#////////////////////////////////////N,X = ms()ans = [0]*(X+1)for _ in range(N):a,b = ms()ans[a] = max(ans[a],b)tmp = b-1for a2 in reversed(range(1,a)):ans[a2] = max(ans[a2],tmp)tmp -= 1if tmp==0: breaktmp = b-1for a2 in range(a+1,X+1):ans[a2] = max(ans[a2],tmp)tmp -= 1if tmp==0: breakprint(*ans[1:])