AC 250, tried atcoder virtual contest, wasn't even half bad
This commit is contained in:
36
atcoder/beginner_contests/250/a.cpp
Normal file
36
atcoder/beginner_contests/250/a.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user