結果

問題 No.973 余興
ユーザー chinchillachinchilla
提出日時 2020-01-29 21:54:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 782 ms / 4,000 ms
コード長 315 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 46,384 KB
最終ジャッジ日時 2024-09-16 02:43:14
合計ジャッジ時間 38,067 ms
ジャッジサーバーID
(参考情報)
judge6 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, numpy as np
n, x = map(int, input().split())
a = np.genfromtxt(sys.stdin, dtype=int)
b = np.vstack((np.zeros((2, n), dtype=int), a, a))
while b.shape[1] > 1:
	b, c = b[:,:-1], b[:,1:]
	b[0] += c[2]
	b[1] = c[1] + b[3]
	b[2] = c[2]
	b[:2, np.logical_and(b[0]>x, b[1]>x)] = 0
print("A" if b[0,0] else "B")
0