結果

問題 No.973 余興
コンテスト
ユーザー chinchilla
提出日時 2020-01-29 21:54:00
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 691 ms / 4,000 ms
+ 276µs
コード長 315 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 285 ms
コンパイル使用メモリ 21,156 KB
実行使用メモリ 38,372 KB
最終ジャッジ日時 2026-08-28 10:39:10
合計ジャッジ時間 37,447 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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