Submission #942612

# Submission time Handle Problem Language Result Execution time Memory
942612 2024-03-11T01:23:21 Z yeediot Meetings (JOI19_meetings) C++14
Compilation error
0 ms 0 KB
#include "meetings.h"
#include<bits/stdc++.h>
using namespace std;
mt19937 rng(time(0));
int K;
bool cmp(int a,int b){
    return Query(K,a,b)==a;
}
void qq(int a,int b){
    if(a>b)swap(a,b);
    Bridge(a,b);
}
void go(int k,vector<int>temp){
    if(sz(temp)==0)return;
    int n=sz(temp);
    int k2=rng()%n;
    K=k;
    vector<int>child[n],path;
    for(auto i:temp){
        int p=Query(k,k2,i);
        if(p==i){
            path.push_back(i);
        }
        else{
            child[p].push_back(i);
        }
    }
    sort(path.begin(),path.end(),cmp);
    for(int i=0;i<n;i++){
        if(!i){
            qq(k,path[i]);
        }
        else{
            qq(path[i-1],path[i]);
        }
    }
    go(k,child[k]);
    for(auto i:path){
        go(i,child[i]);
    }
}
void Solve(int N){
    int n=N;
    int k=rng()%n;
    vector<int>temp;
    for(int i=0;i<n;i++){
        if(i!=k)temp.push_back(i);
    }
    go(k,temp);
}
 /*
 input:
 
 */















 

Compilation message

meetings.cpp: In function 'void go(int, std::vector<int>)':
meetings.cpp:14:8: error: 'sz' was not declared in this scope
   14 |     if(sz(temp)==0)return;
      |        ^~
meetings.cpp:15:11: error: 'sz' was not declared in this scope
   15 |     int n=sz(temp);
      |           ^~