Submission #693440

# Submission time Handle Problem Language Result Execution time Memory
693440 2023-02-03T03:41:47 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);
	for(int i = 0; i < 9; i++){
		int temp1 = (i/3) - 1, temp2 = (i % 3) - 1;
		if(values[i] == 1) continue;
		int pos = (values[i] - 2) / 49, rem = (values[i] - 2) % 49;
		int pos1 = temp1 + (rem / 7) - 3, pos2 = temp2 + (rem % 7) - 3;
		if(pos1 < 0) dirs[pos] = 3;
		else if(pos1 > 0) dirs[pos] = 2;
		else if(pos2 < 0) dirs[pos] = 1;
		else if(pos2 > 0) dirs[pos] = 0;
		else dirs[pos] = 4;
	}
	return dirs;
}
#include "Anna.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;

int n, a[N];

void Anna(int N, int K, vector<int> r, vector<int> c){
	for(int i = 0; i < N; i++){
		for(int j = 0; j < N; j++){
			int temp = ((i % 3) * 3 + (j % 3));
			if(temp >= K){
				SetFlag(i, j, 1);
				continue;
			}
			else{
				int pos1 = r[temp], pos2 = c[temp];
				int diff1 = r[temp] - i;
				diff1 = min(diff1, 3);
				diff1 = max(diff1, -3);
				int diff2 = c[temp] - j;
				diff2 = min(diff2, 3);
				diff2 = max(diff2, -3);
				SetFlag(i, j, 2 + temp * 49 + diff1 * 7 + diff2);
			}
		}
	}
}

/*
signed main(){
	ios_base::sync_with_stdio(0);
	int t;
	cin >> t;
	while(t--) process();
}*/

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/cccjHV7x.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

Bruno.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;
      |                ~~~~~^~~
Bruno.cpp: In function 'void Anna(int, int, std::vector<int>, std::vector<int>)':
Bruno.cpp:30:9: warning: unused variable 'pos1' [-Wunused-variable]
   30 |     int pos1 = r[temp], pos2 = c[temp];
      |         ^~~~
Bruno.cpp:30:25: warning: unused variable 'pos2' [-Wunused-variable]
   30 |     int pos1 = r[temp], pos2 = c[temp];
      |                         ^~~~
/usr/bin/ld: /tmp/ccwqCufi.o: in function `main':
grader_bruno.cpp:(.text.startup+0x1d3): undefined reference to `Bruno(int, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: /tmp/ccES4SJh.o: in function `Anna(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)':
Bruno.cpp:(.text+0xb0): undefined reference to `SetFlag(int, int, int)'
/usr/bin/ld: Bruno.cpp:(.text+0xed): undefined reference to `SetFlag(int, int, int)'
collect2: error: ld returned 1 exit status