답안 #220212

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
220212 2020-04-07T10:41:32 Z WLZ 길고양이 (JOI20_stray) C++14
4 / 100
71 ms 17404 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;

namespace {
  struct edge {
    int from, to, idx;
  };
  vector< vector<edge> > g;

  vector<int> solve1234(int N, int M, vector<int> U, vector<int> V) {
    queue<int> q;
    q.push(0);
    vector<int> dist(N, -1), p(N, -1), ans(M);
    dist[0] = 0;
    while (!q.empty()) {
      int u = q.front(); q.pop();
      for (auto& e : g[u]) {
        if (dist[e.to] == -1) {
          dist[e.to] = dist[u] + 1;
          ans[e.idx] = dist[u] % 3;
          p[e.to] = u;
          q.push(e.to);
        } else if (e.to != p[u]) {
          ans[e.idx] = dist[u] % 3;
        }
      }
    }
    return ans;
  }

  vector<int> solve567(int N, int M, vector<int> U, vector<int> V) {

  }
}

vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
  g.resize(N);
  for (int i = 0; i < M; i++) {
    g[U[i]].push_back({U[i], V[i], i});
    g[V[i]].push_back({V[i], U[i], i});
  }
  if (A >= 3) {
    return solve1234(N, M, U, V);
  } else {
    return solve567(N, M, U, V);
  }
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;

namespace {
  int A, B;
}

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

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

Compilation message

Anthony.cpp: In function 'std::vector<int> {anonymous}::solve567(int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:34:3: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Correct 60 ms 16576 KB Output is correct
2 Correct 9 ms 648 KB Output is correct
3 Correct 50 ms 15680 KB Output is correct
4 Correct 69 ms 17396 KB Output is correct
5 Correct 69 ms 17404 KB Output is correct
6 Correct 62 ms 16316 KB Output is correct
7 Correct 62 ms 16216 KB Output is correct
8 Correct 62 ms 16852 KB Output is correct
9 Correct 62 ms 16900 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 60 ms 16576 KB Output is correct
2 Correct 9 ms 648 KB Output is correct
3 Correct 50 ms 15680 KB Output is correct
4 Correct 69 ms 17396 KB Output is correct
5 Correct 69 ms 17404 KB Output is correct
6 Correct 62 ms 16316 KB Output is correct
7 Correct 62 ms 16216 KB Output is correct
8 Correct 62 ms 16852 KB Output is correct
9 Correct 62 ms 16900 KB Output is correct
10 Incorrect 49 ms 14340 KB Wrong Answer [6]
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 14132 KB Output is correct
2 Correct 9 ms 648 KB Output is correct
3 Correct 46 ms 13368 KB Output is correct
4 Correct 71 ms 15060 KB Output is correct
5 Correct 71 ms 15224 KB Output is correct
6 Correct 61 ms 14044 KB Output is correct
7 Correct 63 ms 14128 KB Output is correct
8 Correct 60 ms 14676 KB Output is correct
9 Correct 71 ms 14540 KB Output is correct
10 Correct 64 ms 14428 KB Output is correct
11 Correct 55 ms 14300 KB Output is correct
12 Correct 55 ms 14468 KB Output is correct
13 Correct 64 ms 14436 KB Output is correct
14 Correct 60 ms 14812 KB Output is correct
15 Correct 70 ms 14716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 14132 KB Output is correct
2 Correct 9 ms 648 KB Output is correct
3 Correct 46 ms 13368 KB Output is correct
4 Correct 71 ms 15060 KB Output is correct
5 Correct 71 ms 15224 KB Output is correct
6 Correct 61 ms 14044 KB Output is correct
7 Correct 63 ms 14128 KB Output is correct
8 Correct 60 ms 14676 KB Output is correct
9 Correct 71 ms 14540 KB Output is correct
10 Correct 64 ms 14428 KB Output is correct
11 Correct 55 ms 14300 KB Output is correct
12 Correct 55 ms 14468 KB Output is correct
13 Correct 64 ms 14436 KB Output is correct
14 Correct 60 ms 14812 KB Output is correct
15 Correct 70 ms 14716 KB Output is correct
16 Correct 49 ms 12612 KB Output is correct
17 Correct 54 ms 12500 KB Output is correct
18 Incorrect 51 ms 12568 KB Wrong Answer [6]
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 776 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 23 ms 4608 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 19 ms 4608 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -