답안 #706930

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
706930 2023-03-08T06:51:08 Z vjudge1 CEOI16_icc (CEOI16_icc) C++17
컴파일 오류
0 ms 0 KB
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
*/
// lethal option

#include "icc.h"
#include<bits/stdc++.h>
using namespace std;

#define all(flg) flg.begin(), flg.end()
#define int long long
#define pb push_back
#define fi first
#define se second
#define endl "\n"
#define eb emplace_back
#define ii pair<int, int>
#define vi vector<int>
#define PI 3.141592653589793238462643383279502884
#define ll long long
#define ld long double
#define for1(i, ff, gg) for(int i = ff; i <= gg; ++i)
#define for2(i, ff, gg) for(int i = ff; i >= gg; --i)
const ll mod = 1e9 + 7;
const int maxN = 300005;
const ll oo = 1e18 + 7;
int n, a[maxN];
int x, y, z, k;

vi bag[maxN];
int cnt = 0;
int par[maxN];

int find(int i){
    if(i == par[i]) return i;
    return par[i] = find(par[i]);
}
/*
void setRoad(int n1, int n2){

}

int query(int n1, int n2, vi f1, vi f2){
    return 1;
}
*/
int spec_qry(vi f1, vi f2){
    return query(f1.size(), f2.size(), f1.begin(), f2.begin());
}

int qry(vi f1, vi f2){
    vi co1, co2;
    for(int id : f1) for(int cc : bag[id]) co1.pb(cc);
    for(int id : f2) for(int cc : bag[id]) co2.pb(cc);
    return spec_qry(f1, f2);
}

void run(int N){
    n = N;
    for1(i, 1, n) par[i] = i;
    for1(whattheactual, 2, n){
        for1(i, 1, n) bag[i].clear();
        for1(i, 1, n) bag[find(i)].pb(i);
        cnt = 0;
        for1(i, 1, n) if(bag[i].size()) swap(bag[cnt++], bag[i]);
        vi c1, c2;
        for1(bt, 0, mod){
            c1.clear();
            c2.clear();
            for1(i, 0, cnt - 1){
                if(i & (1 << bt)) c1.pb(i);
                else c2.pb(i);
            }
            if(qry(c1, c2)) break;
        }
        vi co1, co2;
        for(int id : c1) for(int cc : bag[id]) co1.pb(cc);
        for(int id : c2) for(int cc : bag[id]) co2.pb(cc);
        for1(dumb, 0, 1){
            swap(co1, co2);
            while(co1.size() > 1){
                vi f1, f2;
                x = 0;
                for(int cc : co1){
                    if(x) f1.pb(cc);
                    else f2.pb(cc);
                    x = !x;
                }
                if(spec_qry(f1, co2)) co1 = f1;
                else co1 = f2;
            }
        }
        setRoad(co1[0], co2[0]);
    }
}

signed main(){
    // freopen(".inp", "r", stdin);
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);

}

Compilation message

icc.cpp: In function 'long long int spec_qry(std::vector<long long int>, std::vector<long long int>)':
icc.cpp:50:48: error: cannot convert 'std::vector<long long int>::iterator' to 'int*'
   50 |     return query(f1.size(), f2.size(), f1.begin(), f2.begin());
      |                                        ~~~~~~~~^~
      |                                                |
      |                                                std::vector<long long int>::iterator
In file included from icc.cpp:8:
icc.h:10:30: note:   initializing argument 3 of 'int query(int, int, int*, int*)'
   10 | int query(int a, int b, int *A, int *B);
      |                         ~~~~~^