답안 #710193

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
710193 2023-03-15T05:38:01 Z penguin133 길고양이 (JOI20_stray) C++17
5 / 100
47 ms 16888 KB
#include <bits/stdc++.h>
using namespace std;
#include "Anthony.h"
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
 
namespace {
 
int FunctionExample(int i, int A) {
  return i % A;
}
 
vector <int> adj[20005];
int dist[20005];
}  // namespace
 
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);
  for(int i=0;i<M;i++){
	  adj[U[i]].push_back(V[i]);
	  adj[V[i]].push_back(U[i]);
  }
  queue <int> qu;
  for(int i=0;i<N;i++)dist[i] = 1e9;
  dist[0] = 0;
  qu.push(0);
  while(!qu.empty()){
	  int x = qu.front(); qu.pop();
	  for(auto i : adj[x]){
		  if(dist[i] > dist[x] + 1)dist[i] = dist[x] + 1, qu.push(i);
	  }
  }
  for(int i=0;i<M;i++){
	  int x = max(dist[U[i]], dist[V[i]]);
	  X[i] = x % 2;
  }
  return X;
}
#include <bits/stdc++.h>
using namespace std;
#include "Catherine.h"
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
 
namespace {
 
int A, B;
int variable_example = 0;
 int prv= -1;
}  // namespace
 
void Init(int A, int B) {
  ::A = A;
  ::B = B;
}
 
int Move(std::vector<int> y) {
  ++variable_example;
  for (int j = 0; j < A; ++j) {
    if (y[j] == 1 && j != prv) {
		prv = j;
      return j;
    }
  }
  return -1;
}

Compilation message

Anthony.cpp:15:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
   15 | int FunctionExample(int i, int A) {
      |     ^~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 38 ms 15296 KB Output is correct
2 Correct 2 ms 1028 KB Output is correct
3 Correct 31 ms 15136 KB Output is correct
4 Correct 45 ms 16888 KB Output is correct
5 Correct 46 ms 16804 KB Output is correct
6 Incorrect 33 ms 15588 KB Wrong Answer [6]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 38 ms 15296 KB Output is correct
2 Correct 2 ms 1028 KB Output is correct
3 Correct 31 ms 15136 KB Output is correct
4 Correct 45 ms 16888 KB Output is correct
5 Correct 46 ms 16804 KB Output is correct
6 Incorrect 33 ms 15588 KB Wrong Answer [6]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 12924 KB Output is correct
2 Correct 1 ms 1028 KB Output is correct
3 Correct 28 ms 12856 KB Output is correct
4 Correct 45 ms 14644 KB Output is correct
5 Correct 45 ms 14660 KB Output is correct
6 Correct 34 ms 13384 KB Output is correct
7 Incorrect 31 ms 13324 KB Wrong Answer [6]
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 12924 KB Output is correct
2 Correct 1 ms 1028 KB Output is correct
3 Correct 28 ms 12856 KB Output is correct
4 Correct 45 ms 14644 KB Output is correct
5 Correct 45 ms 14660 KB Output is correct
6 Correct 34 ms 13384 KB Output is correct
7 Incorrect 31 ms 13324 KB Wrong Answer [6]
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1284 KB Output is correct
2 Correct 2 ms 1048 KB Output is correct
3 Correct 2 ms 1284 KB Output is correct
4 Correct 2 ms 1284 KB Output is correct
5 Correct 2 ms 1284 KB Output is correct
6 Correct 2 ms 1284 KB Output is correct
7 Correct 2 ms 1284 KB Output is correct
8 Correct 2 ms 1292 KB Output is correct
9 Correct 2 ms 1296 KB Output is correct
10 Correct 2 ms 1276 KB Output is correct
11 Correct 2 ms 1360 KB Output is correct
12 Correct 2 ms 1296 KB Output is correct
13 Correct 2 ms 1296 KB Output is correct
14 Correct 2 ms 1296 KB Output is correct
15 Correct 2 ms 1288 KB Output is correct
16 Correct 2 ms 1288 KB Output is correct
17 Correct 3 ms 1288 KB Output is correct
18 Correct 3 ms 1296 KB Output is correct
19 Correct 2 ms 1288 KB Output is correct
20 Correct 2 ms 1356 KB Output is correct
21 Correct 2 ms 1348 KB Output is correct
22 Correct 2 ms 1296 KB Output is correct
23 Correct 2 ms 1288 KB Output is correct
24 Correct 2 ms 1344 KB Output is correct
25 Correct 2 ms 1296 KB Output is correct
26 Correct 3 ms 1296 KB Output is correct
27 Correct 2 ms 1296 KB Output is correct
28 Correct 2 ms 1296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 11092 KB Output is correct
2 Correct 41 ms 11596 KB Output is correct
3 Correct 1 ms 1032 KB Output is correct
4 Correct 31 ms 11032 KB Output is correct
5 Correct 41 ms 12604 KB Output is correct
6 Correct 47 ms 12608 KB Output is correct
7 Incorrect 40 ms 11852 KB Wrong Answer [6]
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 30 ms 11132 KB Output is correct
2 Correct 33 ms 11456 KB Output is correct
3 Correct 1 ms 1028 KB Output is correct
4 Correct 35 ms 11260 KB Output is correct
5 Correct 39 ms 13092 KB Output is correct
6 Correct 39 ms 13144 KB Output is correct
7 Incorrect 28 ms 12332 KB Wrong Answer [6]
8 Halted 0 ms 0 KB -