Submission #959781

#TimeUsernameProblemLanguageResultExecution timeMemory
959781GrindMachineRobot Contest (IOI23_robot)C++17
16 / 100
110 ms5892 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

template<typename T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define pb push_back
#define endl '\n'
#define sz(a) (int)a.size()
#define setbits(x) __builtin_popcountll(x)
#define ff first
#define ss second
#define conts continue
#define ceil2(x,y) ((x+y-1)/(y))
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define yes cout << "Yes" << endl
#define no cout << "No" << endl

#define rep(i,n) for(int i = 0; i < n; ++i)
#define rep1(i,n) for(int i = 1; i <= n; ++i)
#define REP(i,s,e) for(int i = s; i <= e; ++i)
#define rev(i,s,e) for(int i = s; i >= e; --i)
#define trav(i,a) for(auto &i : a)

template<typename T>
void amin(T &a, T b) {
    a = min(a,b);
}

template<typename T>
void amax(T &a, T b) {
    a = max(a,b);
}

#ifdef LOCAL
#include "debug.h"
#else
#define debug(x) 42
#endif

/*



*/

const int MOD = 1e9 + 7;
const int N = 1e5 + 5;
const int inf1 = int(1e9) + 5;
const ll inf2 = ll(1e18) + 5;

#include "robot.h"

void program_pulibot()
{
    // set_instruction({0, -2, -1, 0, -2}, 1, 'E');
    // set_instruction({0, 1, -1, 0, -2}, 1, 'E');
    // set_instruction({0, 1, 0, -2, -2}, 1, 'S');
    // set_instruction({0, -1, -2, -2, 1}, 1, 'T');

    REP(c,-2,3){
        REP(w,-2,3){
            REP(s,-2,3){
                REP(e,-2,3){
                    REP(n,-2,3){
                        vector<int> v = {c,w,s,e,n};

                        int one_cnt = 0;
                        for(auto x : {c,w,s,e,n}){
                            one_cnt += (x == 1);
                        }

                        if(c == 0){
                            set_instruction(v,1,'H');
                            conts;
                        }

                        if(c != 1) conts;

                        // (n-1,m-1)
                        if(e == -2 and s == -2){
                            set_instruction(v,1,'T');
                            conts;
                        }

                        // right
                        if(e == 0){
                            set_instruction(v,1,'E');
                        }
                        // down
                        else if(s == 0){
                            set_instruction(v,1,'S');
                        }                        
                        // if not both, then go back
                        else{
                            if(one_cnt != 2) conts;
                            char ch = '?';
                            if(e == 1) ch = 'E';
                            if(w == 1) ch = 'W';
                            if(n == 1) ch = 'N';
                            if(s == 1) ch = 'S';
                            set_instruction(v,2,ch);
                        }
                    }
                }
            }
        }
    }
}
#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...