結果
| 問題 |
No.71 そろばん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-20 21:07:53 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 832 ms |
| コンパイル使用メモリ | 82,380 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-30 10:54:22 |
| 合計ジャッジ時間 | 1,746 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#include <iostream>
#include <sstream>
#include <vector>
#include <array>
#include <string>
#include <algorithm>
#include <map>
#include <cmath>
#include <random>
using namespace std;
#define REP(i,first,last) for (int i=first;i<last;++i)
#define MAX(x,y) (x > y ? x : y)
#define MIN(x,y) (x < y ? x : y)
int N;
int main(){
cin >> N;
long max = 0;
for (long i=0;i<N;i++) {
long val = (i + 1) * (N - i) + i;
max = MAX(val, max);
}
cout << max << endl;
}