結果
問題 | No.71 そろばん |
ユーザー |
![]() |
提出日時 | 2014-11-20 23:26:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 1,015 bytes |
コンパイル時間 | 603 ms |
コンパイル使用メモリ | 80,720 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-02 19:26:14 |
合計ジャッジ時間 | 1,684 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <vector> #include <string> #include <map> #include <set> #include <queue> #include <stack> #include <algorithm> using namespace std; #define rep(i,j) REP((i), 0, (j)) #define REP(i,j,k) for(int i=(j);(i)<(k);++i) #define BW(a,x,b) ((a)<=(x)&&(x)<=(b)) #define ALL(v) (v).begin(), (v).end() #define LENGTHOF(x) (sizeof(x) / sizeof(*(x))) #define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b) #define SQ(x) ((x)*(x)) #define Mod(x, mod) (((x)+(mod)%(mod)) #define MP make_pair #define PB push_back #define F first #define S second #define INF 1 << 30 #define EPS 1e-10 #define MOD 1000000007 typedef pair<int, int> pi; typedef pair<int, pi> pii; typedef vector<int> vi; typedef queue<int> qi; typedef long long ll; ll N; int main(){ cin >> N; ll res = 0; rep(i, N){ res = max(res, (N-i) + i*(N-i+1)); } cout << res << endl; return 0; }