AC 250, tried atcoder virtual contest, wasn't even half bad

This commit is contained in:
2022-05-10 15:19:23 +02:00
parent dd43fcc0c5
commit 6de6e057ae
8 changed files with 298 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int h, w, r, c;
cin >> h >> w >> r >> c;
int result = 0;
if(h > 1){
result++;
}
if(w > 1){
result++;
}
if(r != 1 && r != h){
result++;
}
if(c != 1 && c != w){
result++;
}
cout << result;
cout << flush;
return 0;
}