답안 #411093

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
411093 2021-05-24T10:54:17 Z 장태환(#7543) 길고양이 (JOI20_stray) C++17
4 / 100
73 ms 21856 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++)
  {
	  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);
		  }
		  if (dist[link[a][i].first] == dist[a] )
		  {
			  X[link[a][i].second] = dist[a] % 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:32: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]
   32 |    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 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 50 ms 20684 KB Output is correct
2 Correct 5 ms 6040 KB Output is correct
3 Correct 41 ms 19980 KB Output is correct
4 Correct 73 ms 21856 KB Output is correct
5 Correct 60 ms 21736 KB Output is correct
6 Correct 46 ms 20444 KB Output is correct
7 Correct 46 ms 20584 KB Output is correct
8 Correct 56 ms 21248 KB Output is correct
9 Correct 59 ms 21348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 50 ms 20684 KB Output is correct
2 Correct 5 ms 6040 KB Output is correct
3 Correct 41 ms 19980 KB Output is correct
4 Correct 73 ms 21856 KB Output is correct
5 Correct 60 ms 21736 KB Output is correct
6 Correct 46 ms 20444 KB Output is correct
7 Correct 46 ms 20584 KB Output is correct
8 Correct 56 ms 21248 KB Output is correct
9 Correct 59 ms 21348 KB Output is correct
10 Correct 50 ms 18656 KB Output is correct
11 Correct 54 ms 18676 KB Output is correct
12 Incorrect 39 ms 18628 KB Wrong Answer [6]
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 18328 KB Output is correct
2 Correct 5 ms 6004 KB Output is correct
3 Correct 46 ms 17720 KB Output is correct
4 Correct 59 ms 19660 KB Output is correct
5 Correct 59 ms 19592 KB Output is correct
6 Correct 46 ms 18364 KB Output is correct
7 Correct 46 ms 18340 KB Output is correct
8 Correct 67 ms 18924 KB Output is correct
9 Correct 55 ms 18992 KB Output is correct
10 Correct 47 ms 18696 KB Output is correct
11 Correct 50 ms 18648 KB Output is correct
12 Correct 50 ms 18684 KB Output is correct
13 Correct 50 ms 18680 KB Output is correct
14 Correct 54 ms 18960 KB Output is correct
15 Correct 54 ms 18924 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 18328 KB Output is correct
2 Correct 5 ms 6004 KB Output is correct
3 Correct 46 ms 17720 KB Output is correct
4 Correct 59 ms 19660 KB Output is correct
5 Correct 59 ms 19592 KB Output is correct
6 Correct 46 ms 18364 KB Output is correct
7 Correct 46 ms 18340 KB Output is correct
8 Correct 67 ms 18924 KB Output is correct
9 Correct 55 ms 18992 KB Output is correct
10 Correct 47 ms 18696 KB Output is correct
11 Correct 50 ms 18648 KB Output is correct
12 Correct 50 ms 18684 KB Output is correct
13 Correct 50 ms 18680 KB Output is correct
14 Correct 54 ms 18960 KB Output is correct
15 Correct 54 ms 18924 KB Output is correct
16 Correct 41 ms 16720 KB Output is correct
17 Correct 42 ms 16712 KB Output is correct
18 Incorrect 40 ms 16748 KB Wrong Answer [6]
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 6000 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 7628 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 13 ms 7668 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -