Submission #00056


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <bits/stdc++.h>
using namespace std;
#define st string
#define ll long long
#define ull unsigned long long
#define all(x) sort(x.begin(),x.end())
#define pq priority_queue<long long>
#define endl "\n"
#define gcd(x,y) __gcd(x,y) //最大公約数
#define lcm(x,y) x/(__gcd(x,y))*y //最小公倍数
const long long INF = 1LL << 60;
template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }
int main() {
int n;
st s;
int big = 'A' - 'a';
cin >> n >> s;
for(int i = 1;i < s.size();i++){
if(s[i-1] == s[i]){
s[i-1] += big;
s[i] += big;
}
}
cout << s << endl;
}

ステータス

項目 データ
問題 0003 - JOI エディタ
ユーザー名 ei2217
投稿日時 2024-03-29 12:07:17
言語 C++17
状態 Accepted
得点 15
ソースコード長 804 Byte
最大実行時間 27 ms
最大メモリ使用量 716 KB

セット

セット 得点 Cases
1 ALL 15 / 15 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
01-01.txt AC 24 ms 604 KB
1
01-02.txt AC 19 ms 576 KB
1
01-03.txt AC 21 ms 420 KB
1
01-04.txt AC 22 ms 392 KB
1
01-05.txt AC 26 ms 488 KB
1
01-06.txt AC 23 ms 332 KB
1
01-07.txt AC 20 ms 424 KB
1
01-08.txt AC 16 ms 644 KB
1
01-09.txt AC 24 ms 616 KB
1
01-10.txt AC 27 ms 716 KB
1
01-11.txt AC 20 ms 564 KB
1
01-12.txt AC 18 ms 536 KB
1
01-13.txt AC 21 ms 504 KB
1
01-14.txt AC 15 ms 352 KB
1