結果

問題 No.2947 Sing a Song
ユーザー miiitomi
提出日時 2024-10-25 21:33:47
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 650 bytes
コンパイル時間 2,766 ms
コンパイル使用メモリ 244,808 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-25 21:33:53
合計ジャッジ時間 5,513 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 2e+18;
const ll MOD = 998244353;

void solve() {
    int N;
    cin >> N;
    string S, T;
    cin >> S >> T;
    int s = S.size(), t = T.size();
    while (N--) {
        int a;
        cin >> a;
        while (a % s != 0) {
            cout << T << " ";
            a -= t;
        }
        while (a > 0) {
            cout << S << " ";
            a -= s;
        }
        cout << "\n";
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
    int T = 1;
    // cin >> T;
    while (T--) solve();
}
0