QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#590495#8726. Magic ShowisirazeevCompile Error//C++201.7kb2024-09-26 01:02:512024-09-26 01:02:52

Judging History

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

  • [2024-09-26 01:02:52]
  • 评测
  • [2024-09-26 01:02:51]
  • 提交

Alice

#include <vector>
#include "Alice.h"

using namespace std;

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

std::vector<std::pair<int,int>> Alice(){
    const int N = 61 * 40 + 61;
    long long x = setN(N);
    vector<pair<int, int>> edges;
    int cnt[N + 1];
    for(int i = 0; i <= N; i++) cnt[i] = 0;
    for(int i = 1; i < 61; i++){
        edges.emplace_back(i, i + 1);
    }
    for(int bit = 60; bit >= 0; bit--){
        if(((x >> bit) & 1) == 1){
            for(int j = 62 + bit * 40; j < 62 + (bit + 1) * 40; j++){
                edges.emplace_back(bit + 1, j);
                cnt[j]++;
            }
        }
    }
    vector<int> v;
    for(int i = 62; i <= N; i++){
        if(cnt[i] == 0)
            v.emplace_back(i);
    }
    int non_zero = 0;
    for(int i = 62; i <= N; i++){
        if(cnt[i] != 0)
            non_zero = i;
    }
    for(int i : v){
        edges.emplace_back(i, non_zero);
    }
    reverse(edges.begin(), edges.end());
    return edges;
}

Bob

#include <vector>
#include "Bob.h"

using namespace std;

long long Bob(std::vector<std::pair<int,int>> V){
    const int N = 61 * 40 + 61;
    int cnt[N + 1];
    for(int i = 0; i <= N; i++) cnt[i] = 0;
    for(int i = 1; i < (int)V.size(); i++){
        pair<int, int> p = V[i];
        cnt[p.first]++, cnt[p.second]++;
    }
    int res = 0;
    for(int i = 1; i <= 61; i++){
        int bit = i - 1;
        if(cnt[i] > 0)
            res += (1 << bit);
    }
    return res;
}

Details

Alice.code: In function ‘std::vector<std::pair<int, int> > Alice()’:
Alice.code:39:5: error: ‘reverse’ was not declared in this scope
   39 |     reverse(edges.begin(), edges.end());
      |     ^~~~~~~