結果
| 問題 | No.3274 Arithmetic Right Shift |
| コンテスト | |
| ユーザー |
nhtloc
|
| 提出日時 | 2025-12-04 11:04:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 1,500 ms |
| コード長 | 549 bytes |
| 記録 | |
| コンパイル時間 | 1,917 ms |
| コンパイル使用メモリ | 196,664 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-12-04 11:04:29 |
| 合計ジャッジ時間 | 2,289 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
while (T--) {
long long K;
string S;
cin >> K >> S;
int n = S.size();
if (K >= n) {
cout << string(n, S[0]) << "\n";
} else {
string result = S;
for (int i = 0; i < K; i++) {
result = result[0] + result.substr(0, n - 1);
}
cout << result << "\n";
}
}
return 0;
}
nhtloc