3 해설

  • 8
    @ 2025-5-18 16:05:01
    #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;
    }
    
    • 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

        搔福瑞没实力还发题解

    • -3
      @ 2025-10-8 14:16:16

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

      • 1

      정보

      ID
      2319
      시간
      1000ms
      메모리
      256MiB
      난이도
      1
      태그
      (N/A)
      제출 기록
      150
      맞았습니다.
      70
      아이디