Submission #72575087


Source Code Expand

#include <bits/stdc++.h>
#include<atcoder/modint>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <boost/multiprecision/cpp_dec_float.hpp>
using namespace std;
using ll=long long;
using ldub=long double;
using str=string;
using tup2=tuple<ll,ll>;
using tup3=tuple<ll,ll,ll>;
using tup4=tuple<ll,ll,ll,ll>;
using tup5=tuple<ll,ll,ll,ll,ll>;
using tup6=tuple<ll,ll,ll,ll,ll,ll>;
using tup7=tuple<ll,ll,ll,ll,ll,ll,ll>;
using tupcl=tuple<char,ll>;
using vec=vector<ll>;
using vec2=vector<vec>;
using vec3=vector<vec2>;
using vec4=vector<vec3>;
using vec5=vector<vec4>;
using vec6=vector<vec5>;
using vecs=vector<str>;
using vecs2=vector<vecs>;
using vecc=vector<char>;
using vecc2=vector<vecc>;
using vect2=vector<tup2>;
using vect3=vector<tup3>;
using vect4=vector<tup4>;
using vect5=vector<tup5>;
using vectcl=vector<tupcl>;
using que=queue<ll>;
using que2=queue<tup2>;
using que3=queue<tup3>;
using que4=queue<tup4>;
using que5=queue<tup5>;
using que6=queue<tup6>;
using que7=queue<tup7>;
using Pque=priority_queue<ll>;
using pque=priority_queue<ll,vec,greater<ll>>;
using Pque2=priority_queue<tup2>;
using pque2=priority_queue<tup2,vect2,greater<tup2>>;
using Pque3=priority_queue<tup3>;
using pque3=priority_queue<tup3,vect3,greater<tup3>>;
using Pque4=priority_queue<tup4>;
using pque4=priority_queue<tup4,vect4,greater<tup4>>;
using Pque5=priority_queue<tup5>;
using pque5=priority_queue<tup5,vect5,greater<tup5>>;
//using namespace boost::multiprecision;
//using lll=cpp_int;
//using longf=cpp_dec_float_100;

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define ins insert
#define tup make_tuple
#define low lower_bound
#define pops(a) __builtin_popcountll(a)
#define all(v) v.begin(),v.end()
#define perm(v) next_permutation(all(v))
#define INF (ll)4e18
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YN(f) cout << ((f)?"Yes":"No") << endl

int main(){
  ll N,Q;
  cin >> N >> Q;
  str S;
  cin >> S;
  ll f=0;
  for(ll q=0;q<Q;q++){
    ll t,x;
    cin >> t >> x;
    x--;
    if(t==1){
      swap(S[f+x],S[f+x+1]);
    }else{
      f+=x+1;
    }
  }
  for(ll i=f;i<N;i++) cout << S[i];
}

Submission Info

Submission Time
Task E - EGFクエリ
User guild2026_267
Language C++23 (GCC 15.2.0)
Score 100
Code Size 2256 Byte
Status AC
Exec Time 264 ms
Memory 5552 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 3604 KiB
00_sample_01.txt AC 1 ms 3520 KiB
00_sample_02.txt AC 1 ms 3608 KiB
01_random_00.txt AC 167 ms 5480 KiB
01_random_01.txt AC 263 ms 5552 KiB
01_random_02.txt AC 20 ms 5500 KiB
01_random_03.txt AC 189 ms 5440 KiB
01_random_04.txt AC 235 ms 4496 KiB
01_random_05.txt AC 242 ms 5328 KiB
01_random_06.txt AC 124 ms 4380 KiB
01_random_07.txt AC 243 ms 5536 KiB
01_random_08.txt AC 234 ms 4496 KiB
01_random_09.txt AC 238 ms 5508 KiB
01_random_10.txt AC 225 ms 4316 KiB
01_random_11.txt AC 248 ms 5372 KiB
01_random_12.txt AC 238 ms 4380 KiB
01_random_13.txt AC 1 ms 3608 KiB
01_random_14.txt AC 264 ms 5392 KiB
01_random_15.txt AC 263 ms 5376 KiB
01_random_16.txt AC 263 ms 5328 KiB