Submission #912640

# Submission time Handle Problem Language Result Execution time Memory
912640 2024-01-19T17:10:56 Z MilosMilutinovic Stray Cat (JOI20_stray) C++14
0 / 100
30 ms 14700 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<a;i++) if(y[i]>0) return i;
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type]
   17 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 14700 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 14700 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 12336 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 12336 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1300 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 9832 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 9796 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -