結果

問題 No.71 そろばん
ユーザー masa
提出日時 2015-02-15 21:08:07
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 59,900 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 20:23:11
合計ジャッジ時間 1,298 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

int main() {
	int n;
	cin >> n;

	long long ans = 0;
	long long val;
	for (int i = 1; i < n; i++) {
		val = (1LL + i) * (n - i) + i;
		ans = max(ans, val);
	}

	cout << ans << endl;
	return 0;
}
0