ABC 314
Table of Contents
https://atcoder.jp/contests/abc314
A. 3.14
https://atcoder.jp/contests/abc314/tasks/abc314_a
B. Roulette
https://atcoder.jp/contests/abc314/tasks/abc314_b
C. Rotate Colored Subsequence
https://atcoder.jp/contests/abc314/tasks/abc314_c
D. LOWER
https://atcoder.jp/contests/abc314/tasks/abc314_d
2026/2/11 自力 AC
全体に対する操作をしたあとに適用された個別の操作を覚えておく。 個別の操作のものはそのまま、全体に対する操作のものはその文字の状態になるようにして出力する。
void solve() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
string S;
cin >> S;
int Q;
cin >> Q;
// state
// -1: 小文字
// 0: そのまま
// 1: 大文字
int state = 0;
set<int> diff;
while (Q--) {
int t, x;
char c;
cin >> t >> x >> c;
x--;
if (t == 1) {
S[x] = c;
diff.erase(x);
if (state != 0) diff.insert(x);
} else if (t == 2) {
state = -1;
diff.clear();
} else {
state = 1;
diff.clear();
}
}
if (state == 1) {
rep(i, N) {
if (diff.count(i)) continue;
if (islower(S[i])) S[i] ^= 32;
}
}
if (state == -1) {
rep(i, N) {
if (diff.count(i)) continue;
if (isupper(S[i])) S[i] ^= 32;
}
}
cout << S << endl;
}
E. Roulettes
https://atcoder.jp/contests/abc314/tasks/abc314_e
F. A Certain Game
https://atcoder.jp/contests/abc314/tasks/abc314_f
G. Amulets
https://atcoder.jp/contests/abc314/tasks/abc314_g