結果
問題 |
No.3067 +10 Seconds Clock
|
ユーザー |
|
提出日時 | 2025-03-21 21:31:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,109 bytes |
コンパイル時間 | 195 ms |
コンパイル使用メモリ | 82,284 KB |
実行使用メモリ | 141,828 KB |
最終ジャッジ日時 | 2025-03-21 21:31:35 |
合計ジャッジ時間 | 6,930 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 23 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) #sys.set_int_max_str_digits(0) #input = sys.stdin.readline #n = int(input()) # #alist = [] #s = input() n,t = map(int,input().split()) a = list(map(int,input().split())) k = int(input()) #for i in range(n): # alist.append(list(map(int,input().split()))) b = set(map(lambda x:int(x)-1,input().split())) l,r = 0,k for _ in range(20): mid = (l+r)//2 now = 0 cnt = t mm = mid f = 1 for i in range(n-1): cnt -= a[i] if cnt <= 0: f = 0 break if mm > 0 and i+1 in b: mm -= 1 cnt += 10 if f == 0: l = mid else: r = mid print(l,r) for mid in range(r-3,r+3): if mid < 0: continue now = 0 cnt = t mm = mid f = 1 for i in range(n-1): cnt -= a[i] if cnt <= 0: f = 0 break if mm > 0 and i+1 in b: mm -= 1 cnt += 10 if f == 1: exit(print(mid)) print(-1)