Last active
November 13, 2016 01:54
-
-
Save whatalnk/38c5bad0df8f5216e780717d21d63d3e to your computer and use it in GitHub Desktop.
AtCoder ABC #040 A [C++]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main() { | |
int n, x; | |
cin >> n >> x; | |
cout << min({x - 1, n - x }) << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment