제출 #1280750

#제출 시각아이디문제언어결과실행 시간메모리
1280750LuvidiRobot Contest (IOI23_robot)C++20
17 / 100
45 ms7508 KiB
#include "robot.h" #include <bits/stdc++.h> using namespace std; #define pii pair<int,int> #define fs first #define sc second pii gt(int x){ return {x>5,(x-2)%4}; } void program_pulibot() { string dd="WSEN"; for(int x=0;x<=9;x++){ for(int w=-2;w<=9;w++){ for(int s=-2;s<=9;s++){ for(int e=-2;e<=9;e++){ for(int n=-2;n<=9;n++){ char d='T'; int c=x; auto[cc,cd]=gt(x); if(w==1||s==1||e==1||n==1){ if(w==-2&&n==-2)d='T'; else if(cd>=0)d=dd[cd]; c=1; }else if(w==-2&&n==-2){ if(!x){ c=2; if(!s)d='S'; else d='E'; }else{ auto[cc,cd]=gt(x); c=x; if(s>=0&&(!s||gt(s).fs!=cc))d='S'; else if(e>=0&&(!e||gt(e).fs!=cc))d='E'; else{ c=2+cd+4*(1-cc); if(s>0)d='S'; else d='E'; } } }else if(s==-2&&e==-2){ if(w>0)cd=0; else if(s>0)cd=1; else if(e>0)cd=2; else cd=3; d=dd[cd]; c=1; }else{ pii p; if(x){ if(cd==0)p=gt(w); else if(cd==1)p=gt(s); else if(cd==2)p=gt(e); else p=gt(n); }else{ if(w>0)p=gt(w),cd=0; else if(s>0)p=gt(s),cd=1; else if(e>0)p=gt(e),cd=2; else p=gt(n),cd=3; } auto[pc,pd]=p; if(!x){ c=2+4*pc+cd; d=dd[cd]; }else{ c=2+4*pc+cd; if(w>=0&&(!w||gt(w).fs!=pc&&dd[gt(w).sc]=='E'))d='W'; else if(s>=0&&(!s||gt(s).fs!=pc&&dd[gt(s).sc]=='N'))d='S'; else if(e>=0&&(!e||gt(e).fs!=pc&&dd[gt(e).sc]=='W'))d='E'; else if(n>=0&&(!n||gt(n).fs!=pc&&dd[gt(n).sc]=='S'))d='N'; else{ if(cd>=0)d=dd[cd]; } } } // if(x==6&&w==5&&s==-1&&e==0&&n==-1)cout<<c<<' '<<d<<'\n'; set_instruction({x,w,s,e,n},c,d); } } } } } }
#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...