Submission #202130

# Submission time Handle Problem Language Result Execution time Memory
202130 2020-02-14T01:38:03 Z Segtree Amusement Park (JOI17_amusement_park) C++14
Compilation error
0 ms 0 KB
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include"Joi.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define chmax(a,b) a=max(a,b)
#define chmin(a,b) a=min(a,b)
#define all(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod
void Joi(int N,int M,vi A,vi B,ll X,int T){
    for(int i=0;i<60;i++){
	bool val=X&(1LL<<i);
	MessageBoard(val,i);
    }
    for(int i=60;i<N;i++){
	MessageBoard(0,i);
    }
}
//----------------

/*int main(){
    
}*/


#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include"Ioi.h"
using namespace std;
typedef long long ll;
#define chmax(a,b) a=max(a,b)
#define chmin(a,b) a=min(a,b)
#define all(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod

vector<ll> g[10010];
ll vis[10010];
void dfs(ll x,bool fi){
    if(vis[x]>=0)return;
    if(fi)vis[x]=0;
    else vis[x]=Move(x);
    for(auto y:g[x]){
	dfs(y,0);
    }
}

ll Ioi(int N,int M,vi A,vi B,int P,int V,int T){
    rep(i,M){
	g[A[i]].push_back(B[i]);
	g[B[i]].push_back(A[i]);
    }
    rep(i,N)vis[i]=-1;
    dfs(P,1);
    vis[P]=V;
    ll ans=0;
    for(int i=0;i<60;i++){
	ans+=(1LL<<i)*vis[i];
    }
    return ans;
}
/*int main(){
    
}*/


Compilation message

/tmp/cclo5Zvb.o: In function `main':
grader_joi.cpp:(.text.startup+0x1ac): undefined reference to `Joi(int, int, int*, int*, long long, int)'
collect2: error: ld returned 1 exit status

Ioi.cpp:29:20: error: 'vi' has not been declared
 ll Ioi(int N,int M,vi A,vi B,int P,int V,int T){
                    ^~
Ioi.cpp:29:25: error: 'vi' has not been declared
 ll Ioi(int N,int M,vi A,vi B,int P,int V,int T){
                         ^~
Ioi.cpp: In function 'll Ioi(int, int, int, int, int, int, int)':
Ioi.cpp:31:7: error: invalid types 'int[int]' for array subscript
  g[A[i]].push_back(B[i]);
       ^
Ioi.cpp:31:23: error: invalid types 'int[int]' for array subscript
  g[A[i]].push_back(B[i]);
                       ^
Ioi.cpp:32:7: error: invalid types 'int[int]' for array subscript
  g[B[i]].push_back(A[i]);
       ^
Ioi.cpp:32:23: error: invalid types 'int[int]' for array subscript
  g[B[i]].push_back(A[i]);
                       ^