Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created November 20, 2016 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/dc8fe160343b8fea1e6b2876a1239f90 to your computer and use it in GitHub Desktop.
Save whatalnk/dc8fe160343b8fea1e6b2876a1239f90 to your computer and use it in GitHub Desktop.
AtCoder ABC #031 A. ゲーム [C++]
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int a, d;
cin >> a >> d;
if (a <= d) {
cout << (a + 1) * d << endl;
} else {
cout << a * (d + 1) << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment