結果
問題 | No.71 そろばん |
ユーザー |
![]() |
提出日時 | 2016-08-27 21:23:52 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 306 bytes |
コンパイル時間 | 467 ms |
コンパイル使用メモリ | 56,416 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 20:00:25 |
合計ジャッジ時間 | 1,390 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); long long N, ans = 0; cin >> N; for (long long n = 1; n <= N / 2;n++) { //ans = max(ans, n*(N - n) + n + (N - n)); ans = max(ans, N*n + N - n*n); } cout << ans << endl; return 0; }