Submission #909353

# Submission time Handle Problem Language Result Execution time Memory
909353 2024-01-17T07:30:53 Z Faisal_Saqib Robots (APIO13_robots) C++17
0 / 100
1 ms 348 KB
#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 time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -