답안 #415084

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
415084 2021-05-31T13:59:48 Z 송준혁(#7511) Navigation 2 (JOI21_navigation2) C++17
0 / 100
1 ms 192 KB
#include "Anna.h"
#include <bits/stdc++.h>

namespace {

}

void Anna(int N, int K, std::vector<int> R, std::vector<int> C) {
	int T[10];
	T[0] = 1;
	for (int i=1; i<K; i++) T[i] = T[i-1]*3;
	for (int i=0; i<N; i++) for (int j=0; j<=N; j++){
		int x=0;
		for (int k=0; k<K; k++)x += (abs(i-R[k]) + abs(j-C[k]))%3 * T[k];
		SetFlag(i, j, x);
	}
}
#include "Bruno.h"
#include <vector>

namespace {

}

std::vector<int> Bruno(int K, std::vector<int> value) {
	int T[10];
	T[0] = 1;
	for (int i=1; i<K; i++) T[i] = T[i-1]*3;
	std::vector<int> ans;
	for (int k=0; k<K; k++){
		int p = value[4]/T[k]%3;
		if (p==0){
			if (value[5]/T[k]%3 == 2) ans.push_back(0);
			if (value[3]/T[k]%3 == 2) ans.push_back(1);
			if (value[7]/T[k]%3 == 2) ans.push_back(2);
			if (value[1]/T[k]%3 == 2) ans.push_back(3);
		}
		if (p==1){
			if (value[5]/T[k]%3 == 0) ans.push_back(0);
			if (value[3]/T[k]%3 == 0) ans.push_back(1);
			if (value[7]/T[k]%3 == 0) ans.push_back(2);
			if (value[1]/T[k]%3 == 0) ans.push_back(3);
		}
		if (p==2){
			if (value[5]/T[k]%3 == 1) ans.push_back(0);
			if (value[3]/T[k]%3 == 1) ans.push_back(1);
			if (value[7]/T[k]%3 == 1) ans.push_back(2);
			if (value[1]/T[k]%3 == 1) ans.push_back(3);
		}
		if (ans.size() == k) ans.push_back(4);
	}
	return ans;
}

Compilation message

Bruno.cpp: In function 'std::vector<int> Bruno(int, std::vector<int>)':
Bruno.cpp:33:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   33 |   if (ans.size() == k) ans.push_back(4);
      |       ~~~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 192 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -