結果
| 問題 | No.3274 Arithmetic Right Shift |
| コンテスト | |
| ユーザー |
nhtloc
|
| 提出日時 | 2025-12-04 10:58:46 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 1,500 ms |
| + 926µs | |
| コード長 | 634 bytes |
| 記録 | |
| コンパイル時間 | 1,149 ms |
| コンパイル使用メモリ | 212,900 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-18 21:10:29 |
| 合計ジャッジ時間 | 2,513 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
string shift_once(const string &S) {
return S[0] + S.substr(0, S.size() - 1);
}
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