답안 #647951

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
647951 2022-10-04T17:02:31 Z beaconmc 길고양이 (JOI20_stray) C++14
15 / 100
67 ms 16892 KB
#include "Anthony.h"

#include <bits/stdc++.h>

typedef long long ll;
using namespace std;


#define FOR(i, x, y) for(ll i=x; i<y; i++)
#define FORNEG(i, x, y) for(ll i=x; i>y; i--)

#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)

namespace{}


vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {

  vector<int> edges[N];
  FOR(i,0,M){
    edges[U[i]].push_back(V[i]);
    edges[V[i]].push_back(U[i]);
  }
  bool visited[N];
  FOR(i,0,N) visited[i] = false;


  vector<int> x(N);
  FOR(i,0,N) x[i] = 0;
  queue<vector<int>> q;
  visited[0] = true;

  q.push({0,0});
  while (q.size()){
    vector<int> node = q.front();
    q.pop();
    x[node[0]] = node[1];
    for (auto&i : edges[node[0]]){
      if (!visited[i]){
        visited[i] = true;
        q.push({i, node[1]+1});
      }
    }
  }
  vector<int> ans(M);
  FOR(i,0,M){
    ans[i] = (min(x[U[i]], x[V[i]])%3);
  }



  return ans;

}
#include "Catherine.h"
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;


#define FOR(i, x, y) for(ll i=x; i<y; i++)
#define FORNEG(i, x, y) for(ll i=x; i>y; i--)

#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)

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) {


  if (!y[0] && y[1] && y[2]){
    return 1;
  }
  if (y[0] && !y[1] && y[2]){
    return 2;
  }
  if (y[0] && y[1] && !y[2]){
    return 0;

  }
  if (y[0] && !y[1] && !y[2]){
    return 0;
  }
  if (!y[0] && y[1] && !y[2]){
    return 1;
  }
  if (!y[0] && !y[1] && y[2]){
    return 2;
  }

}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
   48 | }
      | ^
Catherine.cpp: At global scope:
Catherine.cpp:16:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   16 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 15216 KB Output is correct
2 Correct 0 ms 508 KB Output is correct
3 Correct 34 ms 15712 KB Output is correct
4 Correct 52 ms 16852 KB Output is correct
5 Correct 49 ms 16892 KB Output is correct
6 Correct 43 ms 15632 KB Output is correct
7 Correct 41 ms 15564 KB Output is correct
8 Correct 49 ms 16184 KB Output is correct
9 Correct 47 ms 16204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 15216 KB Output is correct
2 Correct 0 ms 508 KB Output is correct
3 Correct 34 ms 15712 KB Output is correct
4 Correct 52 ms 16852 KB Output is correct
5 Correct 49 ms 16892 KB Output is correct
6 Correct 43 ms 15632 KB Output is correct
7 Correct 41 ms 15564 KB Output is correct
8 Correct 49 ms 16184 KB Output is correct
9 Correct 47 ms 16204 KB Output is correct
10 Correct 36 ms 13804 KB Output is correct
11 Correct 38 ms 13728 KB Output is correct
12 Correct 38 ms 13540 KB Output is correct
13 Correct 34 ms 13604 KB Output is correct
14 Correct 44 ms 13800 KB Output is correct
15 Correct 49 ms 14168 KB Output is correct
16 Correct 50 ms 16424 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 12952 KB Output is correct
2 Correct 1 ms 516 KB Output is correct
3 Correct 34 ms 12904 KB Output is correct
4 Correct 66 ms 14624 KB Output is correct
5 Correct 67 ms 14548 KB Output is correct
6 Correct 39 ms 13456 KB Output is correct
7 Correct 45 ms 13356 KB Output is correct
8 Correct 60 ms 14020 KB Output is correct
9 Correct 61 ms 13892 KB Output is correct
10 Correct 53 ms 13776 KB Output is correct
11 Correct 40 ms 13700 KB Output is correct
12 Correct 41 ms 13712 KB Output is correct
13 Correct 39 ms 13748 KB Output is correct
14 Correct 47 ms 13980 KB Output is correct
15 Correct 50 ms 13956 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 12952 KB Output is correct
2 Correct 1 ms 516 KB Output is correct
3 Correct 34 ms 12904 KB Output is correct
4 Correct 66 ms 14624 KB Output is correct
5 Correct 67 ms 14548 KB Output is correct
6 Correct 39 ms 13456 KB Output is correct
7 Correct 45 ms 13356 KB Output is correct
8 Correct 60 ms 14020 KB Output is correct
9 Correct 61 ms 13892 KB Output is correct
10 Correct 53 ms 13776 KB Output is correct
11 Correct 40 ms 13700 KB Output is correct
12 Correct 41 ms 13712 KB Output is correct
13 Correct 39 ms 13748 KB Output is correct
14 Correct 47 ms 13980 KB Output is correct
15 Correct 50 ms 13956 KB Output is correct
16 Correct 34 ms 11936 KB Output is correct
17 Correct 39 ms 11980 KB Output is correct
18 Correct 47 ms 11732 KB Output is correct
19 Correct 39 ms 11648 KB Output is correct
20 Correct 38 ms 12248 KB Output is correct
21 Correct 38 ms 11952 KB Output is correct
22 Correct 48 ms 14248 KB Output is correct
23 Correct 37 ms 11776 KB Output is correct
24 Correct 34 ms 11784 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 636 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 11 ms 2180 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 2176 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -