Submission #411094

# Submission time Handle Problem Language Result Execution time Memory
411094 2021-05-24T10:56:48 Z 장태환(#7543) Stray Cat (JOI20_stray) C++17
4 / 100
70 ms 21408 KB
#include "Anthony.h"
#include <vector>
#include <string.h>
#include <queue>
using namespace std;
namespace {

int FunctionExample(int i, int A) {
  return i % A;
}

}  // namespace
vector<int>x;
int dist[200100];
vector<pair<int,int>>link[200100];
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);
  int i;
  for (i = 0; i < M; i++)
  {
	  X[i] = -1;
	  link[U[i]].push_back({ V[i],i });
	  link[V[i]].push_back({ U[i],i });
  }
  queue<int>x;
  x.push(0);
  memset(dist, 1, sizeof(dist));
  dist[0] = 0;
  while (x.size())
  {
	  auto a = x.front();
	  x.pop();
	  for (i = 0; i < link[a].size(); i++)
	  {
		  if (dist[link[a][i].first] > dist[a] + 1)
		  {
			  dist[link[a][i].first] = dist[a] + 1;
			  X[link[a][i].second]=dist[a]%3;
			  x.push(link[a][i].first);
		  }
		 
	  }

  }
  for (i = 0; i < M; i++)
  {
	  if (X[i] == -1)
		  X[i] = dist[U[i]] % 3;
  }
  return X;
}
#include "Catherine.h"
#include <vector>

namespace {

int A, B;
int variable_example = 0;

}  // namespace

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

int Move(std::vector<int> y) {
  ++variable_example;
  int c = 0;
  int d = 0;
  for (int j = 0; j < A; ++j) 
  {
    if (y[j]) {
		c++;
		d += j;
    }
  }
  if (c == 1)
  {
	  return d;
  }
  else
  {
	  for(int j = 0; j < A; ++j)
	  {
		  if (y[j]==0) {
			  return (j + 1) % 3;
		  }
	  }
  }
}

Compilation message

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:33:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |    for (i = 0; i < link[a].size(); i++)
      |                ~~^~~~~~~~~~~~~~~~
Anthony.cpp: At global scope:
Anthony.cpp:8:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
    8 | int FunctionExample(int i, int A) {
      |     ^~~~~~~~~~~~~~~

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:40:1: warning: control reaches end of non-void function [-Wreturn-type]
   40 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 59 ms 20208 KB Output is correct
2 Correct 5 ms 6008 KB Output is correct
3 Correct 40 ms 19724 KB Output is correct
4 Correct 61 ms 21392 KB Output is correct
5 Correct 56 ms 21408 KB Output is correct
6 Correct 48 ms 20124 KB Output is correct
7 Correct 45 ms 20088 KB Output is correct
8 Correct 61 ms 20772 KB Output is correct
9 Correct 57 ms 20700 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 59 ms 20208 KB Output is correct
2 Correct 5 ms 6008 KB Output is correct
3 Correct 40 ms 19724 KB Output is correct
4 Correct 61 ms 21392 KB Output is correct
5 Correct 56 ms 21408 KB Output is correct
6 Correct 48 ms 20124 KB Output is correct
7 Correct 45 ms 20088 KB Output is correct
8 Correct 61 ms 20772 KB Output is correct
9 Correct 57 ms 20700 KB Output is correct
10 Incorrect 41 ms 18268 KB Wrong Answer [6]
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 48 ms 17916 KB Output is correct
2 Correct 5 ms 6000 KB Output is correct
3 Correct 37 ms 17508 KB Output is correct
4 Correct 70 ms 19128 KB Output is correct
5 Correct 67 ms 19136 KB Output is correct
6 Correct 47 ms 17980 KB Output is correct
7 Correct 46 ms 17928 KB Output is correct
8 Correct 53 ms 18524 KB Output is correct
9 Correct 57 ms 18476 KB Output is correct
10 Correct 57 ms 18324 KB Output is correct
11 Correct 57 ms 18184 KB Output is correct
12 Correct 48 ms 18404 KB Output is correct
13 Correct 48 ms 18240 KB Output is correct
14 Correct 53 ms 18540 KB Output is correct
15 Correct 57 ms 18460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 17916 KB Output is correct
2 Correct 5 ms 6000 KB Output is correct
3 Correct 37 ms 17508 KB Output is correct
4 Correct 70 ms 19128 KB Output is correct
5 Correct 67 ms 19136 KB Output is correct
6 Correct 47 ms 17980 KB Output is correct
7 Correct 46 ms 17928 KB Output is correct
8 Correct 53 ms 18524 KB Output is correct
9 Correct 57 ms 18476 KB Output is correct
10 Correct 57 ms 18324 KB Output is correct
11 Correct 57 ms 18184 KB Output is correct
12 Correct 48 ms 18404 KB Output is correct
13 Correct 48 ms 18240 KB Output is correct
14 Correct 53 ms 18540 KB Output is correct
15 Correct 57 ms 18460 KB Output is correct
16 Correct 41 ms 16428 KB Output is correct
17 Correct 45 ms 16348 KB Output is correct
18 Incorrect 46 ms 16420 KB Wrong Answer [6]
19 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 5992 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 7180 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 7204 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -