Submission #909353

#TimeUsernameProblemLanguageResultExecution timeMemory
909353Faisal_SaqibRobots (APIO13_robots)C++17
0 / 100
1 ms348 KiB
#include <iostream> using namespace std; int main() { int n,w,h; cin>>n>>w>>h; int x1=0,y1=0; int x2=0,y2=0; for(int i=0;i<h;i++) { for(int j=0;j<w;j++) { char c; cin>>c; if(c=='1') { x1=i; y1=j; } else if(c=='2') { x2=i; y2=j; } } } cout<<(x1!=x2)*(2-(x1==0 or x2==0 or x1==h-1 or x2==h-1))+(y1!=y2)*(2-(y1==0 or y2==0 or y1==w-1 or y2==w-1))<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...