結果

問題 No.3274 Arithmetic Right Shift
コンテスト
ユーザー syoyudango
提出日時 2025-10-30 21:10:40
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 37 ms / 1,500 ms
コード長 363 bytes
コンパイル時間 3,033 ms
コンパイル使用メモリ 278,732 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-30 21:10:44
合計ジャッジ時間 4,428 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    int T;
    cin >> T;
    while (T--) {
        int K;
        string S;
        cin >> K >> S;
        if (K >= S.size()) {
            cout << string(S.size(), S[0]) << endl;
        } else {
            cout << string(K, S[0]) << S.substr(0, S.size() - K) << endl;
        }
    }
    return 0;
}
0