답안 #622478

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
622478 2022-08-04T10:11:02 Z KLPP 길고양이 (JOI20_stray) C++14
6 / 100
74 ms 39872 KB
#include "Anthony.h"
#include <vector>
#include<bits/stdc++.h>

using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
typedef long long int lld;

namespace {

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

}  // namespace
vector<int>nei[1000000];
int dist[1000000];
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);
	rep(i,0,N){
		dist[i]=-1;
	}
	rep(i,0,M){
		nei[U[i]].push_back(V[i]);
		nei[V[i]].push_back(U[i]);
	}
	dist[0]=0;
	queue<int> q;
	q.push(0);
	while(!q.empty()){
		int v=q.front();
		q.pop();
		trav(a,nei[v]){
			if(dist[a]==-1){
				dist[a]=dist[v]+1;
				q.push(a);
			}
		}
	}
	rep(i,0,M){
		if(dist[U[i]]==dist[V[i]]){
			X[i]=3;
		}else{
			X[i]=min(dist[U[i]],dist[V[i]])%3;
		}
	}
	//rep(i,0,N)cout<<dist[i]<<endl;
	return X;
}
#include "Catherine.h"
#include <vector>
#include<bits/stdc++.h>

using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
typedef long long int lld;

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 tot=0;
  for (int j = 0; j < 3; ++j) {
	  
    if (y[j] != 0) {
      tot++;
    }
  }
  if(tot==1){
	  for (int j = 0; j < 3; ++j) {
		if (y[j] != 0) {
		  return j;
		}
	  }
  }
  int sum=6;
  for (int j = 0; j < 3; ++j) {
    if (y[j] != 0) {
		//cout<<j<<" ";
      sum-=j;
    }
  }
  sum++;
  sum%=3;
  //cout<<sum<<endl;
  return sum;
}

Compilation message

Anthony.cpp:12:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
   12 | int FunctionExample(int i, int A) {
      |     ^~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 38784 KB Output is correct
2 Correct 13 ms 24112 KB Output is correct
3 Correct 44 ms 38216 KB Output is correct
4 Correct 54 ms 39872 KB Output is correct
5 Correct 63 ms 39828 KB Output is correct
6 Correct 47 ms 38776 KB Output is correct
7 Correct 47 ms 38660 KB Output is correct
8 Correct 58 ms 39392 KB Output is correct
9 Correct 51 ms 39220 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 38784 KB Output is correct
2 Correct 13 ms 24112 KB Output is correct
3 Correct 44 ms 38216 KB Output is correct
4 Correct 54 ms 39872 KB Output is correct
5 Correct 63 ms 39828 KB Output is correct
6 Correct 47 ms 38776 KB Output is correct
7 Correct 47 ms 38660 KB Output is correct
8 Correct 58 ms 39392 KB Output is correct
9 Correct 51 ms 39220 KB Output is correct
10 Correct 44 ms 36580 KB Output is correct
11 Correct 47 ms 36732 KB Output is correct
12 Correct 45 ms 36696 KB Output is correct
13 Correct 46 ms 36580 KB Output is correct
14 Correct 44 ms 36924 KB Output is correct
15 Correct 51 ms 37464 KB Output is correct
16 Correct 53 ms 39416 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 36388 KB Output is correct
2 Correct 12 ms 24108 KB Output is correct
3 Correct 40 ms 35988 KB Output is correct
4 Correct 74 ms 37652 KB Output is correct
5 Correct 59 ms 37648 KB Output is correct
6 Correct 45 ms 36340 KB Output is correct
7 Correct 47 ms 36388 KB Output is correct
8 Correct 51 ms 36996 KB Output is correct
9 Correct 50 ms 37000 KB Output is correct
10 Correct 50 ms 36720 KB Output is correct
11 Correct 48 ms 36840 KB Output is correct
12 Correct 50 ms 36836 KB Output is correct
13 Correct 48 ms 36952 KB Output is correct
14 Correct 51 ms 37136 KB Output is correct
15 Correct 66 ms 37016 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 36388 KB Output is correct
2 Correct 12 ms 24108 KB Output is correct
3 Correct 40 ms 35988 KB Output is correct
4 Correct 74 ms 37652 KB Output is correct
5 Correct 59 ms 37648 KB Output is correct
6 Correct 45 ms 36340 KB Output is correct
7 Correct 47 ms 36388 KB Output is correct
8 Correct 51 ms 36996 KB Output is correct
9 Correct 50 ms 37000 KB Output is correct
10 Correct 50 ms 36720 KB Output is correct
11 Correct 48 ms 36840 KB Output is correct
12 Correct 50 ms 36836 KB Output is correct
13 Correct 48 ms 36952 KB Output is correct
14 Correct 51 ms 37136 KB Output is correct
15 Correct 66 ms 37016 KB Output is correct
16 Incorrect 18 ms 25624 KB Wrong Answer [2]
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 24096 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 23 ms 25636 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 22 ms 25472 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -