이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robot.h"
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
using namespace std;
int c, w, s, e, n;
vector<int> get() {
return {c, w, s, e, n};
}
void final_route() {
c = 5;
for(w = -2; w <= 5; w++) {
for(s = -2; s <= 5; s++) {
for(e = -2; e <= 5; e++) {
for(n = -2; n <= 5; n++) {
if(s == -2 && e == -2) {
set_instruction(get(), 1, 'T');
continue;
}
if(s == 5) {
set_instruction(get(), 1, 'S');
continue;
}
if(e == 5) {
set_instruction(get(), 1, 'E');
continue;
}
}
}
}
}
}
void redefining_route() {
c = 0;
s = e = -2;
for(w = -2; w <= 5; w++) {
for(n = -2; n <= 5; n++) {
if(w > 0) {
set_instruction(get(), 5, 'W');
continue;
}
if(n > 0) {
set_instruction(get(), 5, 'N');
continue;
}
}
}
for(c = 1; c < 5; c++) {
for(w = -2; w <= 5; w++) {
for(s = -2; s <= 5; s++) {
for(e = -2; e <= 5; e++) {
for(n = -2; n <= 5; n++) {
if(w != 5 && s != 5 && e != 5 && n != 5)
continue;
if(w == -2 && n == -2) {
if(s == 5) {
set_instruction(get(), 1, 'S');
continue;
}
if(e == 5) {
set_instruction(get(), 1, 'E');
continue;
}
continue;
}
if(w > 0 && w != 5) {
set_instruction(get(), 5, 'W');
continue;
}
if(n > 0 && n != 5) {
set_instruction(get(), 5, 'N');
continue;
}
}
}
}
}
}
}
void finding_route() {
const string dir = "SE";
for(c = 0; c < 3; c++) {
for(w = -2; w < 3; w++) {
for(s = -2; s < 3; s++) {
for(e = -2; e < 3; e++) {
for(n = -2; n < 3; n++) {
if(s == -2 && e == -2)
continue;
bool is = 0;
for(int i = c; i < 2; i++) {
if(i == 0 && s) continue;
if(i == 1 && e) continue;
is = 1;
set_instruction(get(), i + 1, dir[i]);
break;
}
if(is) continue;
if(w > 0) {
set_instruction(get(), 0, 'W');
continue;
}
if(n > 0) {
set_instruction(get(), 0, 'N');
continue;
}
}
}
}
}
}
}
void program_pulibot() {
final_route();
redefining_route();
finding_route();
}
# | 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... |