Submission #912651

# Submission time Handle Problem Language Result Execution time Memory
912651 2024-01-19T17:16:56 Z MilosMilutinovic Stray Cat (JOI20_stray) C++14
0 / 100
26 ms 14716 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){
	int cnt=0;
	for(int i=0;i<a;i++) cnt+=(y[i]>0?1:0);
	if(cnt==1){
		for(int i=0;i<a;i++) if(y[i]>0) return i;
	}
	for(int i=0;i<a;i++){
		if(y[i]==0) return (i-1+3)%3;
	}
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 14716 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 14716 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 12416 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 12416 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1052 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 9956 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 9852 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -