以下の内容はhttps://blog.hamayanhamayan.com/entry/2021/03/21/124238より取得しました。


Difference Max [AtCoder Beginner Contest 196 A]

https://atcoder.jp/contests/abc196/tasks/abc196_a

解説

https://atcoder.jp/contests/abc196/submissions/21118526 全組合せを考えると200×200通りくらいなので、大体4*104通りで全探索できる。
なお、全探索できるかラインは大体106くらい。

全ての組み合わせを確認して、x-yの最大値を求めれば答え。

int a, b, c, d;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> a >> b >> c >> d;
    int ans = -inf;
    rep(x, a, b + 1) rep(y, c, d + 1) chmax(ans, x - y);
    cout << ans << endl;
}



以上の内容はhttps://blog.hamayanhamayan.com/entry/2021/03/21/124238より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14