# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
693438 | minhcool | Navigation 2 (JOI21_navigation2) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 + 3) * 7 + (diff2 + 3));
}
}
}
}
/*
signed main(){
ios_base::sync_with_stdio(0);
int t;
cin >> t;
while(t--) process();
}*/