Submission #1132756

#TimeUsernameProblemLanguageResultExecution timeMemory
1132756SpyrosAlivRobot Contest (IOI23_robot)C++20
0 / 100
0 ms324 KiB
#include <bits/stdc++.h>
#include "robot.h"

void program_pulibot() {
    for (int l = -2; l <= 1; l++) { // right is available
        for (int b = -2; b <= 1; b++) {
            for (int a = -2; a <= 1; a++) {
                set_instruction({0, l, b, 0, a}, 1, 'E');
            }
        }
    }

    for (int r = -2; r <= -1; r++) { // right is unavailable, but bottom is available
        for (int l = -2; l <= 1; l++) {
            for (int a = -2; a <= 1; a++) {
                set_instruction({0, l, 0, r, a}, 1, 'S');
            }
        }
    }

    for (int r = -2; r <= -1; r++) {
        for (int b = -2; b <= -1; b++) { // both below and right are unavailable

            if (b == -2 && r == -2) continue; // its the end
            
            for (int l = -2; l <= 1; l++) {
                // move above, if its uncolored
                set_instruction({0, l, b, r, 0}, 1, 'N');
            }
        }
    }

    for (int a = -2; a <= 1; a++) {
        for (int l = -2; l <= 1; l++) {
            set_instruction({0, l, -2, -2, a}, 1, 'T'); // finisher
        }
    }

    /*
    sub 4: (50%)
    we only ever go right or below

    if its a dead end, move to the previous 1 block, and paint current block in 2

    if we are at colored block, that means we backtracked, so move to either below or right that is uncolored
    if both below and right are in 2, then paint block in 2 and move back to the 1
    */

    // {current, l, b, r, a}

    for (int r = -2; r <= 2; r++) {
        if (r == 0 || r == 1) continue;
        for (int b = -2; b <= 2; b++) {
            if (b == 0 || b == 1) continue;
            if (r == -2 && b == -2) continue;
            for (int a = -2; a <= 2; a++) {
                if (a == 1) continue;
                set_instruction({0, 1, b, r, a}, 2, 'W');
                set_instruction({1, 1, b, r, a}, 2, 'W');
            }
            for (int l = -2; l <= 2; l++) {
                if (l == 1) continue;
                set_instruction({0, l, b, r, 1}, 2, 'N');
                set_instruction({1, l, b, r, 1}, 2, 'N');
            }
        }
    }


    /*
    // only left is available
    for (int r = -2; r <= -1; r++) {
        for (int b = -2; b <= -1; b++) {
            for (int a = -2; a )
        }
    }*/
}
#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...