結果

問題 No.2947 Sing a Song
ユーザー cologne
提出日時 2025-04-28 13:17:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 80,940 KB
最終ジャッジ日時 2025-04-28 13:17:15
合計ジャッジ時間 6,225 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left, bisect_right
from collections import defaultdict
import math
import sys


def input():
    return sys.stdin.readline().strip()


def main():

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

    for i in a:
        for j in range(i + 1):
            if (i - len(t) * j) % len(s) == 0:
                print(*([t] * j + [s] * ((i - len(t) * j) // len(s))))
                break


if __name__ == "__main__":
    main()
0