제출 #1025799

#제출 시각아이디문제언어결과실행 시간메모리
1025799Gray로봇 대회 (IOI23_robot)C++17
16 / 100
123 ms5648 KiB
#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 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...