結果
| 問題 |
No.3274 Arithmetic Right Shift
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-10-19 15:21:30 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 1,500 ms |
| コード長 | 465 bytes |
| コンパイル時間 | 3,027 ms |
| コンパイル使用メモリ | 276,112 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-19 15:21:34 |
| 合計ジャッジ時間 | 3,874 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int inf=1e18;
void solve(){
int k;cin>>k;
string s;cin>>s;
if(s.size()<=k){
cout<<string(s.size(),s.front())<<"\n";
return ;
}
for(int i=0;i<k;i++)cout<<s.front();
for(int i=k;i<s.size();i++)cout<<s[i-k];
cout<<"\n";
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;cin>>t;
while(t--){
solve();
}
}