QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#784635#1131. Crossing_8_8_#0 0ms3844kbC++171.5kb2024-11-26 15:35:082024-11-26 15:35:13

Judging History

你现在查看的是最新测评结果

  • [2024-11-26 15:35:13]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3844kb
  • [2024-11-26 15:35:08]
  • 提交

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%