Submission #694966

# Submission time Handle Problem Language Result Execution time Memory
694966 2023-02-04T15:54:42 Z minhcool Navigation 2 (JOI21_navigation2) C++17
Compilation error
0 ms 0 KB
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
 
//#define int long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
 
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
 
const int N = 3e5 + 5;
 
const int oo = 1e18 + 7, mod = 1e9 + 7;
 
vector<int> Bruno(int K, vector<int> values){
	vector<int> dirs;
	dirs.resize(K);
	int pos = -1;
	for(int i = 0; i < 9; i++){
		if(values[i] == 1){
			pos = i;
			break;
		}
	}
	int pos1 = (pos / 3) - 1, pos2 = (pos % 3) - 1;
	int posi = -1;
	for(int i = 0; i < 2; i++){
		for(int j = 1; j < 3; j++){
			int pos3 = pos1 + i, pos4 = pos2 + j;
			while(pos3 >= 2) pos3 -= 3;
			while(pos4 >= 2) pos4 -= 3;
			posi++;
			if(posi == 8) break;
			int x = values[posi] - 1;
			if(x <= 5) dirs[pos] = x - 2;
			else{
				int pos5 = pos3 + ((x - 6) / 3) - 1;
				int pos6 = pos4 + ((x - 6) % 3) - 1;
				if(pos6 > 0) dirs[pos] = 0;
				else if(pos6 < 0) dirs[pos] = 1;
				else if(pos5 > 0) dirs[pos] = 2;
				else if(pos5 < 0) dirs[pos] = 3;
				else dirs[pos] = 4;
			}
		}
	}
	return dirs;
}



    

Compilation message

Anna.cpp:17:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   17 | const int oo = 1e18 + 7, mod = 1e9 + 7;
      |                ~~~~~^~~
/usr/bin/ld: /tmp/cciAto0N.o: in function `main':
grader_anna.cpp:(.text.startup+0x345): undefined reference to `Anna(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/ccUVKSUw.o: in function `main':
grader_bruno.cpp:(.text.startup+0x1d3): undefined reference to `Bruno(int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status