結果
問題 |
No.1020 Reverse
|
ユーザー |
![]() |
提出日時 | 2020-04-10 21:48:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 620 bytes |
コンパイル時間 | 910 ms |
コンパイル使用メモリ | 82,344 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 20:07:04 |
合計ジャッジ時間 | 1,559 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 WA * 14 |
ソースコード
#include <stdio.h> #include <math.h> #include <iostream> #include <algorithm> #include <vector> #include <numeric> #include <string> #include <map> #include <stack> using namespace std; typedef long long int lli; #define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++) #define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--) int main(void) { int N, K; cin >> N >> K; string s; cin >> s; for (int i = 0; i < N - K + 1; i++) { //reverse(s.begin() + i, s.begin() + (i + K)); swap(s[i], s[i + K - 1]); } cout << s << endl; return 0; }