Submission #521982

# Submission time Handle Problem Language Result Execution time Memory
521982 2022-02-03T14:42:35 Z new_acc Stray Cat (JOI20_stray) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "Anthony.h"
#define fi first
#define se second
#define rep(a, b) for(int a = 0; a < (b); a++)
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<ll> vl;
const int N=2e4+10;
int deg[N],kol[N];
bool vis[N];
vi graf[N];
void bfs(){
	deque<int> deq;
	deq.push_back(0),vis[0]=1;
	while(deq.size()){
		int v=deq.front();
		deq.pop_front();
		for(auto u:graf[v]){
			if(!vis[u]){
				deg[u]=deg[v]+1,vis[u]=1;
				deq.push_back(u);
			}
		}
	}
}
vi Mark(int n,int m,int a,int b,vi u,vi v){
	rep(i,m) graf[u[i]].push_back(v[i]),graf[v[i]].push_back(u[i]);
	bfs();
	rep(i,n) kol[i]=(i==0?0:(kol[i-1]+1)%3);
	vi res;
	rep(i,m) res.push_back(kol[min(deg[u[i]],deg[v[i]])]);
	return res;
}
#include<bits/stdc++.h>
#include "Catherine.h"
#define fi first
#define se second
#define rep(a, b) for(int a = 0; a < (b); a++)
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<ll> vl;
const int N=2e4+10;
int il;
void Init(int a,int b){
	il=a;
}
int Move(vi t){
	if(il==3){
		bool c[3];
		c[0]=c[1]=c[2]=0;
		rep(i,t.size()) c[i]=(t[i]>0?1:0);
		if(c[0]>0 and c[1]>0) return 0;
		if(c[1]>0 and c[2]>0) return 1;
		if(c[2]>0 and c[0]>0) return 2;
		if(c[0]) return 0;
		if(c[1]) return 1;
		return 2;
	}
	return 1;
}

Compilation message

/usr/bin/ld: /tmp/ccAhyp8w.o: in function `main':
grader_anthony.cpp:(.text.startup+0x191): undefined reference to `Mark(int, int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status

Catherine.cpp: In function 'int Move(vi)':
Catherine.cpp:5:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define rep(a, b) for(int a = 0; a < (b); a++)
      |                                    ^
Catherine.cpp:19:3: note: in expansion of macro 'rep'
   19 |   rep(i,t.size()) c[i]=(t[i]>0?1:0);
      |   ^~~
/usr/bin/ld: /tmp/ccTxVH6f.o: in function `main':
grader_catherine.cpp:(.text.startup+0xcfa): undefined reference to `Move(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status