結果

問題 No.71 そろばん
ユーザー oooooba
提出日時 2021-12-04 18:27:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 552 bytes
コンパイル時間 1,173 ms
コンパイル使用メモリ 115,188 KB
最終ジャッジ日時 2025-01-26 03:35:44
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std; // NOLINT

int main() {
    int64_t n;
    cin >> n;
    int64_t ans = 0;
    for (auto i = 0; i <= n; ++i) {
        ans = max(ans, (i + 1) * (n - i + 1) - 1);
    }
    cout << ans << endl;
    return 0;
}
0