Submission #1082272

#TimeUsernameProblemLanguageResultExecution timeMemory
1082272mickey080929Robot Contest (IOI23_robot)C++17
9 / 100
176 ms6504 KiB
#include "robot.h"
#include <bits/stdc++.h>

using namespace std;

char dir[] = {' ', 'W', 'S', 'E', 'N'};

void set_instruction(std::vector<int> S, int Z, char A);

pair<int,char> cal(vector<int> S) {
    if (S[1] == 1 || S[2] == 1 || S[3] == 1 || S[4] == 1) {
        for (int i=1; i<=4; i++) {
            if (S[i] == 6) {
                return {7, dir[i]};
            }
        }
        for (int i=1; i<=4; i++) {
            if (S[i] > 1) {
                return {1, dir[i]};
            }
        }
        return {1, 'T'};
    }
    if (S[0] == 7) {
        for (int i=1; i<=4; i++) {
            if (S[i] == 6) {
                return {7, dir[i]};
            }
        }
        for (int i=1; i<=4; i++) {
            if (2<=S[i] && S[i]<=5 && (S[i] - 1 - i + 4) % 4 == 2) {
                return {6, dir[i]};
            }
        }
        return {1, 'T'};
    }
    if (S[0] == 6) {
        for (int i=1; i<=4; i++) {
            if (S[i] == 7) {
                return {0, dir[i]};
            }
        }
        return {1, 'T'};
    }
    for (int i=1; i<=4; i++) {
        if (S[i] == 0) {
            return {i+1, dir[i]};
        }
    }
    if (S[2] == -2 && S[3] == -2) {
        for (int i=1; i<=4; i++) {
            if (S[i] > 1 && S[i] != 6) {
                return {1, dir[i]};
            }
        }
    }
    return {7, 'H'};
}

void program_pulibot()
{
    for (int a=-2; a<=7; a++) {
        for (int b=-2; b<=7; b++) {
            for (int c=-2; c<=7; c++) {
                for (int d=-2; d<=7; d++) {
                    for (int e=-2; e<=7; e++) {
                        auto ret = cal({a, b, c, d, e});
                        set_instruction({a, b, c, d, e}, ret.first, ret.second);
                    }
                }
            }
        }
    }
}
#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...