Submission #217447

# Submission time Handle Problem Language Result Execution time Memory
217447 2020-03-29T17:39:23 Z Pajaraja Stray Cat (JOI20_stray) C++17
15 / 100
1103 ms 17352 KB
#include "Anthony.h"
#define MAXN 20007
#include <bits/stdc++.h>

namespace {
	int a,b;
	int d[MAXN];
	std::vector<int> g[MAXN];
}

std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V) 
{
	std::vector<int> X(M);
	a=A;
	for(int i=0;i<M;i++) g[U[i]].push_back(V[i]);
	for(int i=0;i<M;i++) g[V[i]].push_back(U[i]);
	if(a>=3)
  	{
  		d[0]=0;
  		std::fill(d+1,d+N,-1);
  		std::queue<int> q;
  		q.push(0);
		while(!q.empty())
  		{
  			int u=q.front();
			q.pop();
  			for(int i=0;i<g[u].size();i++) if(d[g[u][i]]==-1)
  			{
  				d[g[u][i]]=d[u]+1;
  				q.push(g[u][i]);
			}		
		for(int i=0;i<M;i++) X[i]=std::min(d[U[i]],d[V[i]])%3;
		}
	}
	else
	{
		
	}
  	return X;
}
#include "Catherine.h"
#include <bits/stdc++.h>

namespace {

int a, b;

}  // namespace

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

int Move(std::vector<int> y) {
  	if(a>=3) for(int i=0;i<3;i++) if(y[i]==0 && y[(i+1)%3]!=0) return (i+1)%3;
  	return -1;
}

Compilation message

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:27:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for(int i=0;i<g[u].size();i++) if(d[g[u][i]]==-1)
                  ~^~~~~~~~~~~~
Anthony.cpp: At global scope:
Anthony.cpp:6:8: warning: '{anonymous}::b' defined but not used [-Wunused-variable]
  int a,b;
        ^
# Verdict Execution time Memory Grader output
1 Correct 1045 ms 16184 KB Output is correct
2 Correct 9 ms 1536 KB Output is correct
3 Correct 1034 ms 15272 KB Output is correct
4 Correct 1048 ms 17352 KB Output is correct
5 Correct 1078 ms 17104 KB Output is correct
6 Correct 1059 ms 15696 KB Output is correct
7 Correct 1062 ms 15692 KB Output is correct
8 Correct 1047 ms 16328 KB Output is correct
9 Correct 1095 ms 16528 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1045 ms 16184 KB Output is correct
2 Correct 9 ms 1536 KB Output is correct
3 Correct 1034 ms 15272 KB Output is correct
4 Correct 1048 ms 17352 KB Output is correct
5 Correct 1078 ms 17104 KB Output is correct
6 Correct 1059 ms 15696 KB Output is correct
7 Correct 1062 ms 15692 KB Output is correct
8 Correct 1047 ms 16328 KB Output is correct
9 Correct 1095 ms 16528 KB Output is correct
10 Correct 880 ms 14016 KB Output is correct
11 Correct 898 ms 13988 KB Output is correct
12 Correct 904 ms 14024 KB Output is correct
13 Correct 916 ms 14024 KB Output is correct
14 Correct 897 ms 14020 KB Output is correct
15 Correct 888 ms 14404 KB Output is correct
16 Correct 1080 ms 16712 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1054 ms 13524 KB Output is correct
2 Correct 10 ms 1536 KB Output is correct
3 Correct 1012 ms 13228 KB Output is correct
4 Correct 1050 ms 14900 KB Output is correct
5 Correct 1061 ms 15228 KB Output is correct
6 Correct 1069 ms 13768 KB Output is correct
7 Correct 1081 ms 13760 KB Output is correct
8 Correct 1076 ms 14344 KB Output is correct
9 Correct 1055 ms 14288 KB Output is correct
10 Correct 1053 ms 14104 KB Output is correct
11 Correct 1045 ms 13896 KB Output is correct
12 Correct 1103 ms 14016 KB Output is correct
13 Correct 1083 ms 13984 KB Output is correct
14 Correct 1061 ms 14256 KB Output is correct
15 Correct 1071 ms 14348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1054 ms 13524 KB Output is correct
2 Correct 10 ms 1536 KB Output is correct
3 Correct 1012 ms 13228 KB Output is correct
4 Correct 1050 ms 14900 KB Output is correct
5 Correct 1061 ms 15228 KB Output is correct
6 Correct 1069 ms 13768 KB Output is correct
7 Correct 1081 ms 13760 KB Output is correct
8 Correct 1076 ms 14344 KB Output is correct
9 Correct 1055 ms 14288 KB Output is correct
10 Correct 1053 ms 14104 KB Output is correct
11 Correct 1045 ms 13896 KB Output is correct
12 Correct 1103 ms 14016 KB Output is correct
13 Correct 1083 ms 13984 KB Output is correct
14 Correct 1061 ms 14256 KB Output is correct
15 Correct 1071 ms 14348 KB Output is correct
16 Correct 878 ms 11992 KB Output is correct
17 Correct 893 ms 12260 KB Output is correct
18 Correct 897 ms 12064 KB Output is correct
19 Correct 907 ms 12104 KB Output is correct
20 Correct 904 ms 12724 KB Output is correct
21 Correct 886 ms 12232 KB Output is correct
22 Correct 1079 ms 14388 KB Output is correct
23 Correct 899 ms 12200 KB Output is correct
24 Correct 930 ms 12004 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 1536 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 47 ms 11284 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 48 ms 11408 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -