よじろめ覚書

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

ABC099B - Stone Monument

問題:B - Stone Monument

#include <iostream>
using namespace std;

int main(void) {
    int a, b;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a >> b;
    cout << (b - a) * (b - a + 1) / 2 - b << "\n";
    return 0;
}