답안 #785903

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
785903 2023-07-17T18:27:26 Z doowey 길고양이 (JOI20_stray) C++14
15 / 100
35 ms 17040 KB
#include "Anthony.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair

namespace {

const int N = (int)20010;
vector<pii> T[N];

}  // namespace


int n, m;
vector<int> idx;
int dep[N];

void make1(){
	queue<int> que;
	for(int i = 0 ; i < n; i ++ ){
		dep[i]=-1;
	}
	for(int i = 0 ; i < m ; i ++ ){
		idx[i]=-1;
	}
	dep[0]=0;
	que.push(0);
	int nd;
	while(!que.empty()){
		nd=que.front();
		que.pop();
		for(auto x : T[nd]){
			if(dep[x.fi] == -1){
				dep[x.fi]=(dep[nd]+1)%3;
				que.push(x.fi);
			}
			if(idx[x.se] == -1) idx[x.se]=dep[nd];
			
		}
	}
}

vector<int> Mark(int _n, int _m, int a, int b, vector<int> u, vector<int> v) {
	n = _n;
	m = _m;
	for(int i = 0 ; i < m ; i ++ ){
		T[u[i]].push_back(mp(v[i],i));
		T[v[i]].push_back(mp(u[i],i));
	}
	idx.resize(m);
	if(a >= 3) make1();
	return idx;
}
#include "Catherine.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair

namespace {

int A;

}  // namespace

void Init(int a, int b) {
	A = a;
}

int move_3(vector<int> y){
	for(int d = 0; d < 3; d ++ ){
		if(y[d] > 0 && y[(d + 1) % 3] > 0) return d;
	}
	for(int d = 0; d < 3; d ++ ){
		if(y[d] > 0) return d;
	}
	return -1;
}

int Move(std::vector<int> y) {
   if(A >= 3) return move_3(y);
   return -1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 15912 KB Output is correct
2 Correct 1 ms 1116 KB Output is correct
3 Correct 25 ms 15252 KB Output is correct
4 Correct 35 ms 17040 KB Output is correct
5 Correct 34 ms 16940 KB Output is correct
6 Correct 27 ms 15656 KB Output is correct
7 Correct 28 ms 15656 KB Output is correct
8 Correct 32 ms 16508 KB Output is correct
9 Correct 32 ms 16368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 15912 KB Output is correct
2 Correct 1 ms 1116 KB Output is correct
3 Correct 25 ms 15252 KB Output is correct
4 Correct 35 ms 17040 KB Output is correct
5 Correct 34 ms 16940 KB Output is correct
6 Correct 27 ms 15656 KB Output is correct
7 Correct 28 ms 15656 KB Output is correct
8 Correct 32 ms 16508 KB Output is correct
9 Correct 32 ms 16368 KB Output is correct
10 Correct 26 ms 13844 KB Output is correct
11 Correct 26 ms 14008 KB Output is correct
12 Correct 25 ms 13856 KB Output is correct
13 Correct 26 ms 13924 KB Output is correct
14 Correct 27 ms 14132 KB Output is correct
15 Correct 27 ms 14512 KB Output is correct
16 Correct 31 ms 16436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 13560 KB Output is correct
2 Correct 1 ms 1036 KB Output is correct
3 Correct 22 ms 13084 KB Output is correct
4 Correct 34 ms 14652 KB Output is correct
5 Correct 35 ms 14780 KB Output is correct
6 Correct 26 ms 13704 KB Output is correct
7 Correct 26 ms 13636 KB Output is correct
8 Correct 31 ms 14296 KB Output is correct
9 Correct 30 ms 14256 KB Output is correct
10 Correct 28 ms 13948 KB Output is correct
11 Correct 27 ms 13900 KB Output is correct
12 Correct 27 ms 13920 KB Output is correct
13 Correct 27 ms 14016 KB Output is correct
14 Correct 30 ms 14264 KB Output is correct
15 Correct 30 ms 14200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 13560 KB Output is correct
2 Correct 1 ms 1036 KB Output is correct
3 Correct 22 ms 13084 KB Output is correct
4 Correct 34 ms 14652 KB Output is correct
5 Correct 35 ms 14780 KB Output is correct
6 Correct 26 ms 13704 KB Output is correct
7 Correct 26 ms 13636 KB Output is correct
8 Correct 31 ms 14296 KB Output is correct
9 Correct 30 ms 14256 KB Output is correct
10 Correct 28 ms 13948 KB Output is correct
11 Correct 27 ms 13900 KB Output is correct
12 Correct 27 ms 13920 KB Output is correct
13 Correct 27 ms 14016 KB Output is correct
14 Correct 30 ms 14264 KB Output is correct
15 Correct 30 ms 14200 KB Output is correct
16 Correct 26 ms 12072 KB Output is correct
17 Correct 24 ms 11888 KB Output is correct
18 Correct 24 ms 11996 KB Output is correct
19 Correct 24 ms 11880 KB Output is correct
20 Correct 27 ms 12580 KB Output is correct
21 Correct 26 ms 12288 KB Output is correct
22 Correct 28 ms 14288 KB Output is correct
23 Correct 24 ms 12092 KB Output is correct
24 Correct 25 ms 12032 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1296 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 22 ms 11184 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 22 ms 11208 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -