QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#559027#9241. SphinxWawiCompile Error//C++171.7kb2024-09-11 19:46:552024-09-11 19:46:56

Judging History

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

  • [2024-09-11 19:46:56]
  • 评测
  • [2024-09-11 19:46:55]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

/*
the current size
the current l and r
the current v
all should be done
*/
// int perform_experiment(vector<int> e){
//     return e.size();
// }

vector<int> find_colours(int n, vector<int> x, vector<int> y){
    vector<int> ans(n);
    vector<int> e, reset(n, -1);

    int sz = 1;
    while(sz < n) sz*=2;

    for(int i = 0; i < n;i++){
        e = reset;
        for(int j = 0; j < n;j++){
            if(j != i) e[j] = j;
        }
        int x = perform_experiment(e);
        if(x == n){
            ans[i] = i;
            continue;
        }
        queue<array<int,3>> q;
        q.push({0, sz/2 - 1, sz/2});
        while(q.size()){
            auto [l,r,v] = q.front();
            q.pop();
            e = reset;
            int curr = l;
            for(int j = 0; j < n;j++){
                if(j != i){
                    e[j] = curr;
                    if(curr != r) curr++;
                }
            }
            x = perform_experiment(e);
            int crs = v/2;
            if(x != v){
                if(l == r){
                    ans[i] = l + 1;
                    break;
                }
                q.push({r + 1, r + crs, crs});
            } else{
                if(l == r){
                    ans[i] = l;
                    break;
                }
                q.push({l, l + crs - 1, crs});
            }
        }
    }
    return ans;
}

// void solve(){
    
// }

// int main(){
//     ios::sync_with_stdio(false);
//     cin.tie(0);
//     cout.tie(0);
//     int t=1;
//     cin >> t;
//     while(t--) solve();
//     return 0;
// }

詳細信息

answer.code: In function ‘std::vector<int> find_colours(int, std::vector<int>, std::vector<int>)’:
answer.code:27:17: error: ‘perform_experiment’ was not declared in this scope
   27 |         int x = perform_experiment(e);
      |                 ^~~~~~~~~~~~~~~~~~