Submission #72574988


Source Code Expand

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define repl(i,a,b) for(ll i=(a);i<(b);i++)
#define all(a) (a).begin(),(a).end()

template <typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;} return false;}
template <typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;} return false;}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int n,q; cin >> n >> q;
  string s; cin >> s;
  int top=0;
  while(q--){
    int type,x; cin >> type >> x;
    if(type == 1){
      x--;
      swap(s[top+x],s[top+x+1]);
    }
    else{
      top+=x;
    }
  }
  rep(i,top,n) cout << s[i];
  cout << endl;
  return 0;
}

Submission Info

Submission Time
Task E - EGFクエリ
User guild2026_183
Language C++23 (GCC 15.2.0)
Score 100
Code Size 780 Byte
Status AC
Exec Time 57 ms
Memory 4492 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 20
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3520 KiB
00_sample_01.txt AC 1 ms 3520 KiB
00_sample_02.txt AC 1 ms 3636 KiB
01_random_00.txt AC 42 ms 4300 KiB
01_random_01.txt AC 57 ms 4332 KiB
01_random_02.txt AC 7 ms 4324 KiB
01_random_03.txt AC 43 ms 4444 KiB
01_random_04.txt AC 55 ms 4356 KiB
01_random_05.txt AC 54 ms 4340 KiB
01_random_06.txt AC 29 ms 4304 KiB
01_random_07.txt AC 55 ms 4396 KiB
01_random_08.txt AC 52 ms 4264 KiB
01_random_09.txt AC 55 ms 4296 KiB
01_random_10.txt AC 52 ms 3984 KiB
01_random_11.txt AC 55 ms 4492 KiB
01_random_12.txt AC 55 ms 4324 KiB
01_random_13.txt AC 1 ms 3572 KiB
01_random_14.txt AC 57 ms 4396 KiB
01_random_15.txt AC 57 ms 4424 KiB
01_random_16.txt AC 57 ms 4376 KiB