結果

問題 No.250 atetubouのzetubou
コンテスト
ユーザー maspy
提出日時 2020-02-02 17:41:19
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ac-library)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 585 ms / 5,000 ms
+ 978µs
コード長 527 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 299 ms
コンパイル使用メモリ 21,536 KB
実行使用メモリ 110,840 KB
最終ジャッジ日時 2026-08-30 11:49:30
合計ジャッジ時間 15,861 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

Q = int(readline())
DXT = np.fromstring(read(), np.int64, sep=' ')

D = DXT[::3]
X = DXT[1::3]
T = DXT[2::3]

U = 3100
INF = 10 ** 16
comb = np.zeros((U,U),np.int64)
comb[0,0] = 1
for n in range(1,U):
    comb[n,:n] += comb[n-1,:n]
    comb[n,1:n+1] += comb[n-1,:n]
    np.minimum(INF, comb[n], out=comb[n])

answer = np.where(comb[X+D-1,D-1] <= T, 'AC', 'ZETUBOU')
print('\n'.join(answer))
0