結果
| 問題 | 
                            No.1020 Reverse
                             | 
                    
| コンテスト | |
| ユーザー | 
                             hanbei_dayo
                         | 
                    
| 提出日時 | 2020-04-10 22:17:39 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 653 bytes | 
| コンパイル時間 | 778 ms | 
| コンパイル使用メモリ | 85,048 KB | 
| 実行使用メモリ | 6,132 KB | 
| 最終ジャッジ日時 | 2024-09-15 20:43:07 | 
| 合計ジャッジ時間 | 1,626 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 9 WA * 6 | 
ソースコード
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define M (998244353)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;
vector<ll>r[100010];
ll rd[100010];
int main(void){
    ll n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    if(k==s.length()){
        for(int i=0;i<n;i++)cout<<s[n-1-i];
        cout<<endl;
    }
    else{
        for(int i=k-1;i<n;i++)cout<<s[i];
        for(int i=0;i<k-1;i++)cout<<s[i];
        cout<<endl;
    }
    return 0;
}
            
            
            
        
            
hanbei_dayo