제출 #885900

#제출 시각아이디문제언어결과실행 시간메모리
885900irmuun로봇 대회 (IOI23_robot)C++17
24 / 100
127 ms6484 KiB
#include<bits/stdc++.h> #include "robot.h" using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() //west-zuun //south-dood //east-baruun //north-deed string s="TWSEN"; vector<int>u[6]; vector<int>t={-1,4,5,2,3}; void program_pulibot(){ u[0]={1,2,3,4}; u[1]={2,3,4,1}; u[2]={3,4,1,2}; u[3]={4,1,2,3}; u[4]={1,2,3,4}; vector<int>v(5); v[0]=0; for(v[0]=0;v[0]<=6;v[0]++){//cur for(v[1]=-2;v[1]<=6;v[1]++){//west for(v[2]=-2;v[2]<=6;v[2]++){//south for(v[3]=-2;v[3]<=6;v[3]++){//east for(v[4]=-2;v[4]<=6;v[4]++){//north //check backward bool back=false,forw=false; for(int i=1;i<5;i++){ if(v[i]==6){ back=true; } if(v[i]==1){ forw=true; } } if(back==true&&v[1]==-2&&v[4]==-2){ forw=true; } if(v[2]==-2&&v[3]==-2&&(v[1]==1||v[4]==1)){ set_instruction(v,1,s[0]); continue; } if(forw){ for(int i=1;i<5;i++){ if(v[i]==6){ set_instruction(v,1,s[i]); break; } } continue; } if(v[2]==-2&&v[3]==-2&&(v[1]==4||v[4]==3)){ back=true; } if(back){ for(int i=1;i<5;i++){ if(v[i]>0&&v[i]<6){ set_instruction(v,6,s[i]); break; } } continue; } int from=v[0]; if(v[0]==0){ for(int i=1;i<=4;i++){ if(v[i]==t[i]){ from=i; break; } } } else{ if(from>0){ from--; } } int nxt=-1; for(auto x:u[from]){ if(v[x]>=0){ nxt=x; break; } } if(nxt==-1) continue; if(v[nxt]==0){ set_instruction(v,nxt+1,s[nxt]); } else{ set_instruction(v,0,s[nxt]); } } } } } } }
#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...