이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robot.h"
#include <algorithm>
#include <iostream>
#define ll long long
#define ln "\n"
using namespace std;
void program_pulibot()
{
set_instruction({0, 0, 0, -2, 1}, 1, 'S');
// 0 0
set_instruction({0, -2, 0, 0, -2}, 1, 'E');
set_instruction({0, -2, -1, 0, -2}, 1, 'E');
set_instruction({0, -2, 0, -1, -2}, 1, 'S');
// 1 0
set_instruction({0, -2, -2, 0, 1}, 1, 'E');
// 0 x
// from down
// set_instruction({0, -1, 1, 0, -2}, 1, 'E');
set_instruction({0, 0, 1, 0, -2}, 1, 'E');
// from up
set_instruction({0, 1, 0, 0, -2}, 1, 'E');
// set_instruction({0, 1, -1, 0, -2}, 1, 'E');
// set_instruction({0, 1, 0, -1, -2}, 1, 'S');
// 1 x
// from_up
set_instruction({0, 0, -2, 0, 1}, 1, 'E');
// set_instruction({0, -1, -2, 0, 1}, 1, 'E');
//from down
set_instruction({0, 1, -2, 0, 0}, 1, 'E');
// set_instruction({0, 1, -2, 0, -1}, 1, 'E');
// set_instruction({0, 1, -2, -1, 0}, 1, 'N');
// 0 w
set_instruction({0, 1, 0, -2, -2}, 1, 'S');
// h w
set_instruction({0, 1, -2, -2, 0}, 1, 'T');
set_instruction({0, 1, -2, -2, -1}, 1, 'T');
set_instruction({0, 0, -2, -2, 1}, 1, 'T');
set_instruction({0, -1, -2, -2, 1}, 1, 'T');
//edges
vector<int> pos;
// 0 0-h 0
pos = {0, 1, 2};
do{
pos[0]--; pos[1]--; pos[2]--;
if (pos[2]==1 or pos[2]==-1) set_instruction({0, -2, pos[0], pos[1], pos[2]}, 1, (pos[0]==0?'S':'E'));
pos[0]++; pos[1]++; pos[2]++;
}while (next_permutation(pos.begin(), pos.end()));
// 0 w - h w
// pos = {0, 1, -1};
do{
pos[0]--; pos[1]--; pos[2]--;
if (pos[2]==1 or pos[2]==-1) set_instruction({0, pos[0], pos[1], -2, pos[2]}, 1, (pos[1]==0?'S':'W'));
pos[0]++; pos[1]++; pos[2]++;
}while (next_permutation(pos.begin(), pos.end()));
// 0 0 - 0 w
// pos = {0, 1, -1};
do{
pos[0]--; pos[1]--; pos[2]--;
if (pos[0]==1 or pos[0]==-1) set_instruction({0, pos[0], pos[1], pos[2], -2}, 1, (pos[1]==0?'S':'E'));
pos[0]++; pos[1]++; pos[2]++;
}while (next_permutation(pos.begin(), pos.end()));
// h 0 - h w
// pos = {0, 1, -1};
do{
pos[0]--; pos[1]--; pos[2]--;
if (pos[0]==1 or pos[0]==-1) set_instruction({0, pos[0], -2, pos[1], pos[2]}, 1, (pos[1]==0?'E':'N'));
pos[0]++; pos[1]++; pos[2]++;
}while (next_permutation(pos.begin(), pos.end()));
//internal
vector<int> lpos(5, -1); lpos[0]=0;
for (ll i=1; i<=4; i++){
for (ll j=1; j<=4; j++){
if (i==j) continue;
lpos[i]=1; lpos[j]=0;
set_instruction(lpos, 1, (j==1?'W':j==2?'S':j==3?'E':'N'));
lpos[i]=lpos[j]=-1;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |