ABC040A - 赤赤赤赤青
問題:A - 赤赤赤赤青
#include <algorithm> #include <iostream> using namespace std; int main(void) { int n, x; cin.tie(0); ios::sync_with_stdio(false); cin >> n >> x; cout << min(n - x, x - 1) << "\n"; return 0; }
問題:A - 赤赤赤赤青
#include <algorithm> #include <iostream> using namespace std; int main(void) { int n, x; cin.tie(0); ios::sync_with_stdio(false); cin >> n >> x; cout << min(n - x, x - 1) << "\n"; return 0; }