Submission #68575025
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define ll unsigned long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pi pair<int, int>
#define ff first
#define ss second
#define fixed(n) fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define sz(a) ((int)(a).size())
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
const ll INF = 1000000009;
const ll M = 1e9 + 7;
const ll INFLL = (ll)INF * (ll)INF;
const ld EPS = 10e-9;
const ld PI = acos(-1);
int dx[] = {0,1,1,1,0,-1,-1,-1,0};
int dy[] = {1,1,0,-1,-1,-1,0,1,0};
void solve(){
int n,m;
cin>>n>>m;
string s,t;
cin>>s;
cin>>t;
vector<bool>v(n,false);
while(m--){
int l,r;
cin>>l>>r;
for(int i = l-1; i <= r-1; i++){
v[i] = !v[i];
}
}
for(int i = 0; i < n; i++){
if(v[i]){
s[i]=t[i];
}
}
cout<<s<<endl;
}
int main()
{
fastio;
//ctrl + shift + p
solve();
return 0;
}
Submission Info
| Submission Time |
|
| Task |
D - Substr Swap |
| User |
storrerguy |
| Language |
C++ 23 (gcc 12.2) |
| Score |
0 |
| Code Size |
2375 Byte |
| Status |
TLE |
| Exec Time |
2207 ms |
| Memory |
4484 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
0 / 400 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
00_sample_00.txt, 00_sample_01.txt |
| All |
00_sample_00.txt, 00_sample_01.txt, 01_test_00.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_00.txt |
AC |
1 ms |
3548 KiB |
| 00_sample_01.txt |
AC |
1 ms |
3468 KiB |
| 01_test_00.txt |
AC |
1 ms |
3480 KiB |
| 01_test_01.txt |
AC |
1 ms |
3480 KiB |
| 01_test_02.txt |
AC |
1 ms |
3476 KiB |
| 01_test_03.txt |
AC |
2 ms |
3492 KiB |
| 01_test_04.txt |
AC |
75 ms |
3388 KiB |
| 01_test_05.txt |
TLE |
2207 ms |
3568 KiB |
| 01_test_06.txt |
AC |
12 ms |
3556 KiB |
| 01_test_07.txt |
AC |
3 ms |
4404 KiB |
| 01_test_08.txt |
TLE |
2207 ms |
4156 KiB |
| 01_test_09.txt |
TLE |
2207 ms |
4484 KiB |
| 01_test_10.txt |
TLE |
2207 ms |
4384 KiB |
| 01_test_11.txt |
TLE |
2207 ms |
4368 KiB |
| 01_test_12.txt |
TLE |
2207 ms |
4364 KiB |
| 01_test_13.txt |
AC |
21 ms |
4196 KiB |