Submission #1025568

#TimeUsernameProblemLanguageResultExecution timeMemory
1025568LIFRobot Contest (IOI23_robot)C++17
0 / 100
1 ms348 KiB
#include "robot.h"
#include<bits/stdc++.h>
using namespace std;

void program_pulibot()
{
    //注 s[0]原地,s[1] 西方,s[2]南方,s[3]東方,s[4]北方
    //第一步,set_instruction 判斷終止程式,當右方、下方都是-2時
    for(int i=-2;i<=1;i++)
    {
        vector<int> temp;
        for(int cc=1;cc<=5;cc++)temp.push_back(-2);
        for(int j=-2;j<=-1;j++)
        {
            for(int k=-2;k<=-1;k++)
            {
                temp[0] = i;
                temp[1] = j;
                temp[4] = k;
                char c = 'T';
                set_instruction(temp,1,c);
            }
        }
    }
    //第二步,向右;當且僅當右方是0時
    for(int i=-2;i<=1;i++)
    {
        vector<int> temp;
        for(int cc=1;cc<=5;cc++)temp.push_back(0);
        for(int j=-2;j<=1;j++)
        {
            for(int k=-2;k<=1;k++)
            {
                for(int p=-2;p<=1;p++)
                {
                    temp[0] = i;
                    temp[1] = j;
                    temp[2] = 0;
                    temp[3] = k;
                    temp[4] = p;
                    char c = 'E';
                    set_instruction(temp,1,c);
                }
            }
        }
    }
    //第三步,向上,當且僅當右方是障礙物(-1)且上方為0
    for(int i=-2;i<=1;i++)
    {
        vector<int> temp;
        for(int cc=1;cc<=5;cc++)temp.push_back(-2);
        for(int j=-2;j<=-1;j++)
        {
            for(int k=-2;k<=-1;k++)
            {
                temp[0] = i;
                temp[1] = j;
                temp[2] = k;
                temp[3] = -1;
                temp[4] = 0;
                char c = 'N';
                set_instruction(temp,1,c);
            }
        }
    }
    //第四步,向下,當且僅當右方是障礙物且下方為0;
    for(int i=-2;i<=1;i++)
    {
        vector<int> temp;
        for(int cc=1;cc<=5;cc++)temp.push_back(-2);
        for(int j=-2;j<=-1;j++)
        {
            for(int k=-2;k<=-1;k++)
            {
                temp[0] = i;
                temp[1] = j;
                temp[2] = 0;
                temp[3] = -1;
                temp[4] = k;
                char c = 'S';
                set_instruction(temp,1,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...