Submission #72574700
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for(int i = 0; i < (int) (n); i ++)
#define rrep(i, m, n) for(int i = (int) m; i < (int) n; i ++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
long long gcd(long long a, long long b){
if(a % b == 0) return b;
else return gcd(b, a % b);
}
long long lcm(long long a, long long b){
return a * b / gcd(a, b);
}
template<typename T>
void v_cin(vector<T> &x){
rep(i, x.size()) cin >> x[i];
}
template<typename T>
void vv_cin(vector<vector<T>> &x){
rep(i, x.size()) rep(j, x[i].size()) cin >> x[i][j];
}
template <typename T>
void v_cout(vector<T> &x){
rep(i, x.size()) cout << x[i] << (i < x.size() - 1 ? " " : "\n");
}
template <typename T>
void vv_cout(vector<vector<T>> &x){
rep(i, x.size()) v_cout(x[i]);
}
// #include <atcoder/all>
// using namespace atcoder;
// using mint = modint998244353;
// using mint = modint1000000007;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N; cin >> N;
string S; cin >> S;
swap(S[N - 2], S[N - 1]);
cout << S << "\n";
}
Submission Info
| Submission Time |
|
| Task |
A - EGFスワップ |
| User |
guild2026_102 |
| Language |
C++23 (GCC 15.2.0) |
| Score |
100 |
| Code Size |
1400 Byte |
| Status |
AC |
| Exec Time |
1 ms |
| Memory |
3700 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
100 / 100 |
| Status |
|
|
| 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 |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_00.txt |
AC |
1 ms |
3628 KiB |
| 00_sample_01.txt |
AC |
1 ms |
3556 KiB |
| 00_sample_02.txt |
AC |
1 ms |
3684 KiB |
| 01_random_00.txt |
AC |
1 ms |
3628 KiB |
| 01_random_01.txt |
AC |
1 ms |
3636 KiB |
| 01_random_02.txt |
AC |
1 ms |
3628 KiB |
| 01_random_03.txt |
AC |
1 ms |
3684 KiB |
| 01_random_04.txt |
AC |
1 ms |
3628 KiB |
| 01_random_05.txt |
AC |
1 ms |
3636 KiB |
| 01_random_06.txt |
AC |
1 ms |
3672 KiB |
| 01_random_07.txt |
AC |
1 ms |
3612 KiB |
| 01_random_08.txt |
AC |
1 ms |
3628 KiB |
| 01_random_09.txt |
AC |
1 ms |
3628 KiB |
| 01_random_10.txt |
AC |
1 ms |
3700 KiB |