結果
問題 | No.71 そろばん |
ユーザー |
![]() |
提出日時 | 2015-01-10 18:16:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 675 bytes |
コンパイル時間 | 816 ms |
コンパイル使用メモリ | 81,256 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-13 03:34:28 |
合計ジャッジ時間 | 1,838 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <iostream> #include <cstdio> #include <string> #include <sstream> #include <algorithm> #include <math.h> #include <map> #include <iomanip> #include <vector> #include <queue> #include <set> #define PI 3.14159265359 #define INF 99999999; #define rep(i, n) for(int i=0; i<n; i++) #define REP(n) rep(i, n) #define EPS 1e-10 typedef long long ll; using namespace std; /* class Target { public: vector <string> draw(int n) { } }; */ int main() { int N; ll max_num = 0; cin >> N; for (ll i=0; i<=N; i++) //iは上の珠の数 { if (max_num < (ll)((N-i+1)*i+(N-i))) { max_num = (ll)((N-i+1)*i+(N-i)); } } cout << max_num << endl; return 0; }