# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
425302 | Osama_Alkhodairy | Navigation 2 (JOI21_navigation2) | C++17 | 0 ms | 192 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 <bits/stdc++.h>
#include "Anna.h"
using namespace std;
//~ 1: move right
//~ 2: move left
//~ 3: move down
//~ 4: move up
//~ 5: (x - 1, y - 1)
//~ 6: (x - 1, y)
//~ 7: (x - 1, y + 1)
//~ 8: (x, y - 1)
//~ 9: (x, y)
//~ 10: (x, y + 1)
//~ 11: (x + 1, y - 1)
//~ 12: (x + 1, y)
//~ 13: (x + 1, y + 1)
int calc(pair <int, int> l, pair <int, int> r){
if(abs(l.first - r.first) > 1){
if(r.first < l.first) return 4;
else return 3;
}
else if(abs(l.second - r.second) > 1){
if(r.second < l.second) return 2;
else return 1;
}
else if(l.first - 1 == r.first){
if(l.second - 1 == r.second) return 5;
else if(l.second == r.second) return 6;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |