結果

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

ソースコード

diff #

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char** argv)
{
	int n; cin >> n;

	long max = 0;
	for (int ii=0; ii<=n; ++ii) {
		long dw = (n-ii);
		long total = (ii * (dw+1)) + dw;
		max = (total>max) ? total : max;
	}
	cout << max << endl;
	return 0;
}
0