QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#784635 | #1131. Crossing | _8_8_# | 0 | 0ms | 3844kb | C++17 | 1.5kb | 2024-11-26 15:35:08 | 2024-11-26 15:35:13 |
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = (int)1e6 + 12;
int n, m;
string t;
vector<string> a(3);
map<string, bool> mem;
string nv(string x, string y) {
string ret;
for(int i = 0; i < n; i++) {
if(x[i] == y[i]) ret += x[i];
else {
char f;
if(x[i] != 'O' && y[i] != 'O') f = 'O';
else if(x[i] != 'J' && y[i] != 'J') f = 'J';
else f = 'I';
ret += f;
}
}
return ret;
}
void out() {
cout << (mem.count(t) ? "Yes\n" : "No\n");
}
void test() {
cin >> n >> a[0] >> a[1] >> a[2];
cin >> m >> t;
queue<string> q;
q.push(a[0]);mem[a[0]];
if(!mem.count(a[1])) q.push(a[1]);mem[a[1]];
if(!mem.count(a[2])) q.push(a[2]);mem[a[2]];
while(!q.empty()) {
auto r = q.front();
// cout << r << '\n';
q.pop();
for(auto f : a) {
string k = nv(f, r);
if(!mem.count(k)) {
// cout << f << ' ' << r << " -> " << k << '\n';
mem[k];
q.push(k);
}
}
a.push_back(r);
}
exit(0);
out();
while(m--) {
int l, r;
char x;
cin >> l >> r >> x;
l--;r--;
for(int i = l; i <= r; i++) {
t[i] = x;
}
out();
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;
//cin >> t;
while(t--)
test();
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3844kb
input:
80 JJIJOJOJOJIJJIJJIJJIJIIIJIIJIJIJIIIJIJOOIIIJIOIIOJJOOJOJJOJJOOIIOOOOOJIIOIJOJIIJ JJIJOJOJOJIJJIJJIJJIJIIIJIIJIJIJIIIJIJOOIIIJIOIIOJJOOJOJJOJJOOIIOOOOOJIIOIJOJIIJ JJIJOJOJOJIJJIJJIJJIJIIIJIIJIJIJIIIJIJOOIIIJIOIIOJJOOJOJJOJJOOIIOOOOOJIIOIJOJIIJ 185606 IIJJOJIOJOIJIJJJJIOOJIIIIIIJIOIIOJOIJOIJOIJOJOI...
output:
result:
wrong answer 1st lines differ - expected: 'No', found: ''
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%