Submission #1026360

#TimeUsernameProblemLanguageResultExecution timeMemory
1026360LIFRobot Contest (IOI23_robot)C++17
25 / 100
120 ms6160 KiB
#include "robot.h" #include<bits/stdc++.h> using namespace std; map <vector<int> ,char> mp; vector< vector<int> > all; void program_pulibot() { //注 s[0]原地,s[1] 西方,s[2]南方,s[3]東方,s[4]北方 //第一步,設定終止程序,當東方、南方都為-2時; for(int i=-2;i<=2;i++) { vector<int> s; for(int i=0;i<=4;i++)s.push_back(-2); for(int j=-2;j<=2;j++) { for(int k=-2;k<=2;k++) { s[0] = i; s[1] = j; s[2] = -2; s[3] = -2; s[4] = k; char c = 'T'; set_instruction(s,1,c); mp[s] = 1; } } } //第二步:if has at least 1 zero; for(int i=-2;i<=2;i++) { vector<int> temp; for(int i=0;i<=4;i++)temp.push_back(-2); for(int j=-2;j<=2;j++) { for(int k=-2;k<=2;k++) { for(int p=-2;p<=2;p++) { for(int l=-2;l<=2;l++) { temp[0] = i; temp[1] = j; temp[2] = k; temp[3] = p; temp[4] = l; if(mp[temp] == 1)continue; if(temp[3] == 0) { char c = 'E'; set_instruction(temp,1,c); } else { if(temp[2] == 0) { char c = 'S';set_instruction(temp,1,c); } else { if(temp[1] == 0) { char c = 'W'; set_instruction(temp,1,c); } else { if(temp[4] == 0) { char c = 'N'; set_instruction(temp,1,c); } else { int cnt1 = 0; for(int i=1;i<=4;i++)if(temp[i] == 0)cnt1++; if(cnt1 >= 2)continue; // 否則只有一個1; if(temp[1] == 1) { char c = 'W'; set_instruction(temp,2,c); } else { if(temp[2] == 1) { char c = 'S'; set_instruction(temp,2,c); } else { if(temp[3] == 1) { char c = 'E'; set_instruction(temp,2,c); } else { if(temp[4] == 1) { char c = 'N'; set_instruction(temp,2,c); } } } } } } } } } } } } } }
#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...