Submission #912641

# Submission time Handle Problem Language Result Execution time Memory
912641 2024-01-19T17:12:24 Z MilosMilutinovic Stray Cat (JOI20_stray) C++14
0 / 100
38 ms 27164 KB
#include "Anthony.h"
#include<bits/stdc++.h>

using namespace std;

namespace {
int n,tot;
int v[40005],nxt[40005],h[20005],d[20005],q[20005];

void addedge(int x,int y){
	v[++tot]=y; nxt[tot]=h[x]; h[x]=tot;
	v[++tot]=x; nxt[tot]=h[y]; h[y]=tot;
}

void bfs(){
	for(int i=0;i<n;i++) d[i]=-1;
	int front=0,rear=0;
	q[rear++]=0; d[0]=0;
	while(front<rear){
		int x=q[front];
		for(int p=h[x];p;p=nxt[p]){
			if(d[v[p]]==-1){
				d[v[p]]=d[x]+1;
				q[rear++]=v[p];
			}
		}
		++front;
	}
}
}

vector<int> Mark(int n,int m,int a,int b,vector<int> u,vector<int> v){
	::n=n;
	for(int i=0;i<m;i++) addedge(u[i],v[i]);
	if(a>=3){
		bfs();
		vector<int> col(m);
		for(int i=0;i<m;i++) col[i]=min(d[u[i]],d[v[i]])%3;
		return col;
	}
	return vector<int>(m,0);
}
#include "Catherine.h"
#include<bits/stdc++.h>

using namespace std;

namespace {

int a,b;
}  // namespace

void Init(int A,int B){
	a=A; b=B;
}

int Move(vector<int> y){
	for(int i=0;i<y.size();i++) if(y[i]>0) return i;
	assert(false);	
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:16:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |  for(int i=0;i<y.size();i++) if(y[i]>0) return i;
      |              ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Runtime error 38 ms 27164 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 38 ms 27164 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 32 ms 22816 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 32 ms 22816 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 1312 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 27 ms 17972 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 27 ms 18008 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -