結果
問題 | No.973 余興 |
ユーザー | convexineq |
提出日時 | 2020-01-17 23:23:43 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,153 bytes |
コンパイル時間 | 388 ms |
コンパイル使用メモリ | 82,192 KB |
実行使用メモリ | 273,180 KB |
最終ジャッジ日時 | 2024-06-26 00:58:04 |
合計ジャッジ時間 | 19,974 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 917 ms
272,464 KB |
testcase_04 | WA | - |
testcase_05 | AC | 708 ms
272,636 KB |
testcase_06 | AC | 729 ms
272,596 KB |
testcase_07 | AC | 699 ms
272,416 KB |
testcase_08 | AC | 723 ms
271,896 KB |
testcase_09 | AC | 683 ms
272,688 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 160 ms
146,148 KB |
testcase_14 | WA | - |
testcase_15 | AC | 93 ms
83,948 KB |
testcase_16 | AC | 93 ms
83,872 KB |
testcase_17 | WA | - |
testcase_18 | AC | 86 ms
82,324 KB |
testcase_19 | AC | 85 ms
82,244 KB |
testcase_20 | AC | 83 ms
80,612 KB |
testcase_21 | AC | 92 ms
83,956 KB |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 86 ms
82,304 KB |
testcase_29 | WA | - |
testcase_30 | AC | 303 ms
272,552 KB |
testcase_31 | AC | 307 ms
272,316 KB |
testcase_32 | AC | 300 ms
272,512 KB |
testcase_33 | AC | 299 ms
272,272 KB |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | AC | 297 ms
267,112 KB |
testcase_37 | AC | 295 ms
266,868 KB |
testcase_38 | WA | - |
testcase_39 | AC | 300 ms
271,956 KB |
testcase_40 | AC | 40 ms
53,764 KB |
testcase_41 | AC | 39 ms
52,000 KB |
testcase_42 | AC | 39 ms
53,196 KB |
testcase_43 | AC | 39 ms
52,692 KB |
testcase_44 | WA | - |
testcase_45 | AC | 49 ms
62,404 KB |
testcase_46 | WA | - |
testcase_47 | AC | 311 ms
272,468 KB |
testcase_48 | WA | - |
testcase_49 | AC | 293 ms
256,584 KB |
testcase_50 | WA | - |
testcase_51 | AC | 316 ms
272,624 KB |
testcase_52 | AC | 313 ms
272,400 KB |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | WA | - |
ソースコード
# coding: utf-8 # Your code here! import sys sys.setrecursionlimit(10**6) readline = sys.stdin.readline read = sys.stdin.read #n,m,*d= [int(i) for i in read().split()] #a,t,k = [int(i) for i in readline().split()] n,x,*a = [int(i) for i in read().split()] r = [0]*n l = [0]*n r[-1] = n-1 pt = 0 res = -a[0] for i in range(n-1): while pt < n and res+a[pt] <= n: res += a[pt] pt += 1 r[i] = pt res -= a[i] pt = n-1 res = -a[n-1] for i in range(n-1,0,-1): while pt >= 0 and res+a[pt] <= n: res += a[pt] pt -= 1 l[i] = pt+1 res -= a[i-1] dp = [[0]*n for _ in range(n)] for i in range(n): dp[i][i] = -1 #for i in dp: print(*i) for j in range(1,n): for k in range(l[j],j): dp[k][j] = 1 #for i in dp: print(*i) #print(l,r) for i in range(n-2,-1,-1): j = i while j < n: if dp[i][j] == 0: dp[i][j] = -1 for k in range(l[i],i): dp[k][j] = 1 dp[i][j+1:r[j]] = [1]*(r[j]-(j+1)) j = r[j] else: j += 1 #print(dp) a = dp[0][-1] if a == 1: print("A") else: print("B")