Submission #1017578

#TimeUsernameProblemLanguageResultExecution timeMemory
1017578tmarcinkeviciusRobot Contest (IOI23_robot)C++17
16 / 100
108 ms5712 KiB
#include<bits/stdc++.h>
using namespace std;
#include "robot.h"
typedef pair<int, int> pii;
#define f first
#define s second

void program_pulibot()
{
    vector<int> S(5);

    vector<pair<int, char>> directions =
        {
            {3, 'E'}, {2, 'S'}, {4, 'N'}, {1, 'W'}};

    for (S[0] = 0; S[0] <= 1; S[0]++)
    {
        for (S[1] = -2; S[1] <= 1; S[1]++)
        {
            for (S[2] = -2; S[2] <= 1; S[2]++)
            {
                for (S[3] = -2; S[3] <= 1; S[3]++)
                {
                    for (S[4] = -2; S[4] <= 1; S[4]++)
                    {
                        if (S[2] == -2 && S[3] == -2)
                        {
                            set_instruction(S, 1, 'T');
                            continue;
                        }
                        for (pair<int, char> p : directions)
                        {
                            if (S[p.f] == 0)
                            {
                                set_instruction(S, 1, p.s);
                                break;
                            }
                        }
                    }
                }
            }
        }
    }
}
#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...