Submission #521984

# Submission time Handle Problem Language Result Execution time Memory
521984 2022-02-03T14:44:56 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(size_t 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(size_t 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

Anthony.cpp: In function 'vi Mark(int, int, int, int, vi, vi)':
Anthony.cpp:5:39: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    5 | #define rep(a, b) for(size_t a = 0; a < (b); a++)
      |                                       ^
Anthony.cpp:29:2: note: in expansion of macro 'rep'
   29 |  rep(i,m) graf[u[i]].push_back(v[i]),graf[v[i]].push_back(u[i]);
      |  ^~~
Anthony.cpp:5:39: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    5 | #define rep(a, b) for(size_t a = 0; a < (b); a++)
      |                                       ^
Anthony.cpp:31:2: note: in expansion of macro 'rep'
   31 |  rep(i,n) kol[i]=(i==0?0:(kol[i-1]+1)%3);
      |  ^~~
Anthony.cpp:5:39: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    5 | #define rep(a, b) for(size_t a = 0; a < (b); a++)
      |                                       ^
Anthony.cpp:33:2: note: in expansion of macro 'rep'
   33 |  rep(i,m) res.push_back(kol[min(deg[u[i]],deg[v[i]])]);
      |  ^~~
/usr/bin/ld: /tmp/ccTu0Fhs.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

/usr/bin/ld: /tmp/ccQjNWqb.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