よじろめ覚書

私の理解度重視のソースコードです。

2019-07-18から1日間の記事一覧

ABC040A - 赤赤赤赤青

ABC

問題: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; }</iostream></algorithm>