結果
| 問題 |
No.80 四角形を描こう
|
| コンテスト | |
| ユーザー |
motxx
|
| 提出日時 | 2014-11-27 23:42:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 465 bytes |
| コンパイル時間 | 1,473 ms |
| コンパイル使用メモリ | 159,224 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-08 03:51:56 |
| 合計ジャッジ時間 | 1,953 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<(long long)b;i++)
#define rep(i,n) REP(i,0,n)
int main() {
long long n; cin >> n;
long long mx = -1<<29;
bool ok = 0;
REP(K, 1, n) {
long long N = n;
N -= 2*K;
if(N < 0) { continue; }
ok = 1;
N /= 2;
mx = max(mx, K*N);
}
if(ok) {
cout << mx << endl;
}
else {
cout << 0 << endl;
}
return 0;
}
motxx