結果

問題 No.2947 Sing a Song
ユーザー cled0328
提出日時 2024-10-25 21:32:13
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 1,974 ms
コンパイル使用メモリ 192,764 KB
最終ジャッジ日時 2025-02-24 22:49:23
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;cin>>n;
    string s,t;cin>>s>>t;
    int S=s.length(),T=t.length();
    for(int i=0;i<n;i++){
        int a;cin>>a;
        while(a%S){
            cout<<t<<" ";
            a-=T;
        }
        while(a){
            cout<<s<<" ";
            a-=S;
        }
        cout<<"\n";
    }
    cout<<"\n";
}
0