Submission #1058468

#TimeUsernameProblemLanguageResultExecution timeMemory
1058468shmaxRobot Contest (IOI23_robot)C++17
15 / 100
98 ms5716 KiB
#include "robot.h"
#include <bits/stdc++.h>

using namespace std;

template<typename T>
using vec = vector<T>;

void program_pulibot() {
    auto process = [&](char c) {
        if (c == 'L') return 'W';
        if (c == 'R') return 'E';
        if (c == 'D') return 'S';
        if (c == 'U') return 'N';
        return c;
    };
    vec<int> all = {-2, -1, 0, 1, 2};
    for (auto cur: all) {
        if (cur == -2 or cur == -1) continue;

        for (auto l: all) {
            for (auto d: all) {
                for (auto r: all) {
                    for (auto u: all) {
                        int Z = -1;
                        char c = '*';
                        if (cur == 0 or cur == 1) {
                            if (d == 0) {
                                Z = 1;
                                c = 'D';
                            } else if (r == 0) {
                                Z = 1;
                                c = 'R';
                            } else if (u == 0) {
                                Z = 1;
                                c = 'U';
                            } else if (l == 0) {
                                Z = 1;
                                c = 'L';
                            } else {
                                Z = 2;
                                if (l == 1) {
                                    c = 'L';
                                } else if (r == 1) {
                                    c = 'R';
                                } else if (u == 1) {
                                    c = 'U';
                                } else if (d == 1) {
                                    c = 'D';
                                }
                            }
                        }
                        if (r == -2 and d == -2) {
                            Z = 1;
                            c = 'T';
                        }

                        if (Z == -1 or c == '*') continue;
                        set_instruction({cur, l, d, r, u}, Z, process(c));
                    }
                }
            }
        }
    }
}
#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...