Submission #849002

#TimeUsernameProblemLanguageResultExecution timeMemory
849002rainboyRobot Contest (IOI23_robot)C++17
26 / 100
109 ms6224 KiB
#include "robot.h" void program_pulibot() { for (int x = -2; x <= 5; x++) for (int w = -2; w <= 5; w++) for (int s = -2; s <= 5; s++) for (int e = -2; e <= 5; e++) for (int n = -2; n <= 5; n++) if (x == 0) { if (e == -2 && s == -2) set_instruction({ x, w, s, e, n }, 3, 'H'); else if (s == 0) set_instruction({ x, w, s, e, n }, 3, 'S'); else if (e == 0) set_instruction({ x, w, s, e, n }, 3, 'E'); else if (w == 3) set_instruction({ x, w, s, e, n }, 2, 'W'); else if (n == 3) set_instruction({ x, w, s, e, n }, 2, 'N'); } else if (x == 2) { if (s == 2) set_instruction({ x, w, s, e, n }, 4, 'S'); else if (e == 2) set_instruction({ x, w, s, e, n }, 4, 'E'); else set_instruction({ x, w, s, e, n }, 4, 'H'); } else if (x == 3) { if (e == -2 && s == -2 || s == 1 || e == 1) { if (s == 2) set_instruction({ x, w, s, e, n }, 5, 'S'); else if (e == 2) set_instruction({ x, w, s, e, n }, 5, 'E'); else set_instruction({ x, w, s, e, n }, 5, 'H'); } else { if (s == 0) set_instruction({ x, w, s, e, n }, 3, 'S'); else if (e == 0) set_instruction({ x, w, s, e, n }, 3, 'E'); else if (w == 3) set_instruction({ x, w, s, e, n }, 2, 'W'); else if (n == 3) set_instruction({ x, w, s, e, n }, 2, 'N'); } } else if (x == 4) { if (s == 2) set_instruction({ x, w, s, e, n }, 4, 'S'); else if (e == 2) set_instruction({ x, w, s, e, n }, 4, 'E'); else if (w == 4 || w == 5) set_instruction({ x, w, s, e, n }, 0, 'W'); else if (n == 4 || n == 5) set_instruction({ x, w, s, e, n }, 0, 'N'); } else if (x == 5) { if (s == 2) set_instruction({ x, w, s, e, n }, 5, 'S'); else if (e == 2) set_instruction({ x, w, s, e, n }, 5, 'E'); else if (w == 3) set_instruction({ x, w, s, e, n }, 1, 'W'); else if (n == 3) set_instruction({ x, w, s, e, n }, 1, 'N'); else set_instruction({ x, w, s, e, n }, 1, 'T'); } }

Compilation message (stderr)

robot.cpp: In function 'void program_pulibot()':
robot.cpp:28:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   28 |        if (e == -2 && s == -2 || s == 1 || e == 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...