제출 #1026056

#제출 시각아이디문제언어결과실행 시간메모리
1026056Andrey로봇 대회 (IOI23_robot)C++17
53 / 100
124 ms6836 KiB
#include "robot.h" #include<bits/stdc++.h> using namespace std; void program_pulibot() { /*set_instruction({0, -2, -1, 0, -2}, 1, 'E'); set_instruction({0, 1, -1, 0, -2}, 1, 'E'); set_instruction({0, 1, 0, -2, -2}, 1, 'S'); set_instruction({0, -1, -2, -2, 1}, 1, 'T');*/ char dir[6] = {'z','T','W','S','E','N'}; for(int c = -2; c < 10; c++) { for(int w = -2; w < 10; w++) { for(int s = -2; s < 10; s++) { for(int e = -2; e < 10; e++) { for(int n = -2; n < 10; n++) { if(c < 0) { continue; } if(c == 0) { if(n == -2 && w == -2) { set_instruction({c,w,s,e,n},6,'H'); } else { if(w > 5) { set_instruction({c,w,s,e,n},2,'W'); } else if(s > 5) { set_instruction({c,w,s,e,n},3,'S'); } else if(e > 5) { set_instruction({c,w,s,e,n},4,'E'); } else if(n > 5) { set_instruction({c,w,s,e,n},5,'N'); } } continue; } if(w == 1 || s == 1 || e == 1 || n == 1) { if(w > 5) { set_instruction({c,w,s,e,n},1,'W'); } else if(s > 5) { set_instruction({c,w,s,e,n},1,'S'); } else if(e > 5) { set_instruction({c,w,s,e,n},1,'E'); } else if(n > 5) { set_instruction({c,w,s,e,n},1,'N'); } else { set_instruction({c,w,s,e,n},1,'T'); } continue; } if(s == -2 && e == -2) { if(n > 5) { set_instruction({c,w,s,e,n},1,'N'); } else { set_instruction({c,w,s,e,n},1,'W'); } continue; } int p = c; char a; if(p > 5) { p-=4; } p++; if(p == 6) { p-=4; } int x; if(p == 2) { x = w; } else if(p == 3) { x = s; } else if(p == 4) { x = e; } else { x = n; } if(x < 0) { set_instruction({c,w,s,e,n},p+4,'H'); } else { if((x-p+1002)%4 == 0 || x == 0) { if(x > 5) { set_instruction({c,w,s,e,n},p,dir[p]); } else { set_instruction({c,w,s,e,n},p+4,dir[p]); } } else { set_instruction({c,w,s,e,n},p+4,'H'); } } } } } } } }

컴파일 시 표준 에러 (stderr) 메시지

robot.cpp: In function 'void program_pulibot()':
robot.cpp:68:30: warning: unused variable 'a' [-Wunused-variable]
   68 |                         char a;
      |                              ^
#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...