結果
| 問題 | No.1020 Reverse |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-10 21:23:06 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 4 ms / 2,000 ms |
| + 130µs | |
| コード長 | 206 bytes |
| 記録 | |
| コンパイル時間 | 328 ms |
| コンパイル使用メモリ | 78,428 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-28 03:39:54 |
| 合計ジャッジ時間 | 1,841 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main()
| ^~~~
ソースコード
#include<iostream>
#include<algorithm>
using namespace std;
int N,K;
string s;
main()
{
cin>>N>>K>>s;
cout<<s.substr(K-1);
s=s.substr(0,K-1);
if((N-K)%2==0)reverse(s.begin(),s.end());
cout<<s<<endl;
}