1 solutions

  • 0
    @ 2025-4-12 9:20:10

    #include<bits/stdc++.h> using namespace std; int main() { int h,w; cin>>h>>w; int r,c; cin>>r>>c; int res=0; if(r-1>=1) res++; if(r+1<=h) res++; if(c-1>=1) res++; if(c+1<=w) res++; cout<<res; return 0; }

    Information

    ID
    2319
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    29
    Accepted
    12
    Uploaded By