Submission #869903

#TimeUsernameProblemLanguageResultExecution timeMemory
869903NeroZeinCrossing (JOI21_crossing)C++17
0 / 100
35 ms2312 KiB
#include "bits/stdc++.h" using namespace std; #ifdef Nero #include "Deb.h" #else #define deb(...) #endif int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<string> s(3); for (int i = 0; i < 3; ++i) cin >> s[i]; set<string> se; auto merge = [&](string a, string b) { string ret; ret.resize(n); for (int i = 0; i < n; ++i) { if (a[i] == b[i]) { ret[i] = a[i]; } else { if (a[i] != 'I' && b[i] != 'I') ret[i] = 'I'; if (a[i] != 'O' && b[i] != 'O') ret[i] = 'O'; if (a[i] != 'J' && b[i] != 'J') ret[i] = 'J'; } } return ret; }; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { for (int k = 0; k < 3; ++k) { se.insert(merge(merge(s[i], s[j]), s[k])); } } } //deb(se) cout << '\n'; int q; cin >> q; string t; cin >> t; cout << (se.count(t) ? "YES" : "NO") << '\n'; while (q--) { int l, r; cin >> l >> r; --l, --r; char c; cin >> c; for (int i = l; i <= r; ++i) { t[i] = c; } cout << (se.count(t) ? "YES" : "NO") << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...