結果

問題 No.2947 Sing a Song
ユーザー nouka28
提出日時 2024-09-23 08:37:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 5,784 ms
コンパイル使用メモリ 82,112 KB
実行使用メモリ 80,020 KB
最終ジャッジ日時 2024-09-23 12:01:52
合計ジャッジ時間 15,406 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
s,t=input().split()
a=list(map(int,input().split()))

ans=[]
for i in a:
    mx=-1
    for j in range(i+1):
        if len(s)*j<=i and (i-len(s)*j)%len(t)==0:
            mx=max(mx,j)
    assert mx!=-1
    
    ans.append(" ".join([s]*mx+[t]*((i-len(s)*mx)//len(t))))

for i in ans:
    print(i)
0