Submission #1299537

#TimeUsernameProblemLanguageResultExecution timeMemory
1299537khoavn2008Robot Contest (IOI23_robot)C++17
16 / 100
42 ms7472 KiB
#include "robot.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define FOR(i,l,r) for(int i = (l), _r = (r); i <= _r; i++)
#define FORNG(i,r,l) for(int i = (r), _l = (l); i >= _l; i--)
#define REP(i,r) for(int i = 0, _r = (r); i < _r; i++)
#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define size(v) ((ll)(v).size())
#define all(v) (v).begin(),(v).end()
#define MASK(x) (1LL << (x))
#define BIT(x,i) (((x) >> (i)) & 1)
const ll MOD = 1e9 + 7, N = 2e5 + 36, LOG = 18;
const ll INF = 1e18 + 36;
#define BLOCK -1
#define WALL -2
#define EMPTY 0
#define PATH 1
#define BLOCKPATH 2
/*
    4
  1 0 3
    2
    N
  W 0 E
    S
*/
void program_pulibot(){
    FOR(CUR,0,1)FOR(W,-2,2)FOR(S,-2,2)FOR(E,-2,2)FOR(N,-2,2){
        if(CUR == EMPTY){
            if(S == WALL && E == WALL){
                set_instruction({CUR, W, S, E, N}, PATH, 'T');
                continue;
            }
            bool keepGo = (E == EMPTY) | (S == EMPTY);
            if(keepGo){
                if(E == EMPTY)set_instruction({CUR, W, S, E, N}, PATH, 'E');
                else set_instruction({CUR, W, S, E, N}, PATH, 'S');
            }else{
                if(W == PATH)set_instruction({CUR, W, S, E, N}, BLOCKPATH, 'W');
                else set_instruction({CUR, W, S, E, N}, BLOCKPATH, 'N');
            }
        }
        if(CUR == PATH){
            bool keepGo = (E == EMPTY) | (S == EMPTY);
            if(keepGo){
                if(E == EMPTY)set_instruction({CUR, W, S, E, N}, PATH, 'E');
                else set_instruction({CUR, W, S, E, N}, PATH, 'S');
            }else{
                if(W == PATH)set_instruction({CUR, W, S, E, N}, BLOCKPATH, 'W');
                else set_instruction({CUR, W, S, E, N}, BLOCKPATH, 'N');
            }
        }
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...