結果
| 問題 |
No.1020 Reverse
|
| コンテスト | |
| ユーザー |
周宣辰
|
| 提出日時 | 2020-04-17 15:46:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 1,242 bytes |
| コンパイル時間 | 1,343 ms |
| コンパイル使用メモリ | 168,712 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-03 10:21:17 |
| 合計ジャッジ時間 | 2,067 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;
int32_t main() {
oneforall
oneforall
oneforall
oneforall
oneforall
oneforall
oneforall
oneforall
oneforall
oneforall
oneforall
oneforall
oneforall
oneforall
ini(n);
ini(n1);
ins(morty);
string morty1 = morty.substr(n1-1);
string morty2 = morty.substr(0,n1-1);
if((n-n1)%2 == 0)reverse(morty2.begin(),morty2.end());
out(morty1+morty2);
return 0;
}
周宣辰