3 solutions

  • 0
    @ 2026-6-21 15:56:04
    #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;
    }
    
    
    • @ 2026-6-21 15:58:38

      搔福瑞没实力还发题解

Information

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