Submission #113735

# Submission time Handle Problem Language Result Execution time Memory
113735 2019-05-28T06:45:44 Z ckodser ICC (CEOI16_icc) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include<icc.h>

#define ll int
#define pb push_back
#define mp make_pair
#define ld long double
#define F first
#define S second
#define pii pair<ll,ll> 

using namespace :: std;

const ll mod=1e9+7;
const ll maxn=500;
const ll inf=1e9+900;

vector<ll> vec[maxn];

int soal(vector<ll> a,vector<ll> b){
    ll A[maxn];
    ll B[maxn];
    for(ll i=0;i<a.size();i++){
	A[i]=a[i];
    }
    for(ll i=0;i<b.size();i++){
	B[i]=b[i];
    }
    return query(a.size(),b.size(),A,B);
}
vector<ll> kamel(vector<ll> v){
    vector<ll> ans;
    for(auto e:v){
	for(auto r:vec[e]){
	    ans.pb(r);
	}
    }
    return ans;
}
ll find_sar(vector<ll> a,vector<lL> b){
    while(a.size()>1){
	vector<ll> aa,aaa;
	for(ll i=0;i<a.size()/2;i++){
	    aa.pb(a[i]);
	}
	for(ll i=a.size()/2;i<a.size();i++){
	    aaa.pb(a[i]);
	}
	bool bo=soal(aa,b);
	if(bo){
	    a=aa;	    
	}else{
	    a=aaa;
	}
    }
    return a[0];
}
void run(ll n){
    for(ll i=1;i<=n;i++){
	vec[i].pb(i);
    }
    for(ll w=1;w<=n-1;w++){
	vector<ll> imp;
	for(ll i=1;i<=n;i++){
	    if(vec[i].size()){
		imp.pb(i);
	    }
	}
	ll m=imp.size();
	vector<ll> v1,v0;
	for(ll i=0;(1<<i)<m;i++){
	    v0.clear();
	    v1.clear();
	    for(ll j=0;j<m;j++){
		if((j>>i)&1){
		    v1.pb(imp[j]);
		}else{
		    v0.pb(imp[j]);
		}
	    }
	    if(v0.size()!=imp.size() && v1.size()!=imp.size()){
		int b=soal(kamel(v0),kamel(v1));
		if(b){
		    break;
		}
	    }
	}
	ll s=find_sar(kamel(v0),kamel(v1));
	ll t=find_sar(kamel(v1),kamel(v0));
	setRoad(s,t);
    }   
}

Compilation message

icc.cpp: In function 'int soal(std::vector<int>, std::vector<int>)':
icc.cpp:23:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(ll i=0;i<a.size();i++){
                ~^~~~~~~~~
icc.cpp:26:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(ll i=0;i<b.size();i++){
                ~^~~~~~~~~
icc.cpp: At global scope:
icc.cpp:40:33: error: 'lL' was not declared in this scope
 ll find_sar(vector<ll> a,vector<lL> b){
                                 ^~
icc.cpp:40:33: note: suggested alternative: 'ld'
 ll find_sar(vector<ll> a,vector<lL> b){
                                 ^~
                                 ld
icc.cpp:40:35: error: template argument 1 is invalid
 ll find_sar(vector<ll> a,vector<lL> b){
                                   ^
icc.cpp:40:35: error: template argument 2 is invalid
icc.cpp: In function 'int find_sar(std::vector<int>, int)':
icc.cpp:43:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(ll i=0;i<a.size()/2;i++){
             ~^~~~~~~~~~~
icc.cpp:46:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(ll i=a.size()/2;i<a.size();i++){
                      ~^~~~~~~~~
icc.cpp:49:19: error: could not convert 'b' from 'int' to 'std::vector<int>'
  bool bo=soal(aa,b);
                   ^
icc.cpp: In function 'void run(int)':
icc.cpp:88:35: error: cannot convert 'std::vector<int>' to 'int' for argument '2' to 'int find_sar(std::vector<int>, int)'
  ll s=find_sar(kamel(v0),kamel(v1));
                                   ^
icc.cpp:89:35: error: cannot convert 'std::vector<int>' to 'int' for argument '2' to 'int find_sar(std::vector<int>, int)'
  ll t=find_sar(kamel(v1),kamel(v0));
                                   ^