結果
問題 |
No.2947 Sing a Song
|
ユーザー |
|
提出日時 | 2024-10-25 22:19:08 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 657 bytes |
コンパイル時間 | 277 ms |
コンパイル使用メモリ | 82,772 KB |
実行使用メモリ | 258,904 KB |
最終ジャッジ日時 | 2024-10-25 22:19:13 |
合計ジャッジ時間 | 5,383 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 11 |
ソースコード
N=int(input()) S,T=input().split() lenS=len(S) lenT=len(T) A=list(map(int,input().split())) for a in A: lencount=0 ans=[] check="" tmp=a//lenS lencount+=lenS*tmp if lencount<a: for i in range(tmp): ans.append(S) check+=S ans.append(T) check+=T else: for i in range(tmp): ans.append(S) check+=S if len(check)==a: print(*ans) elif len(check)>a: for i in range((len(check)-a)//lenS): ans[i]="" print(*ans) else: for i in range((a-len(check))//lenT): ans.append(T) print(*ans)