結果

問題 No.80 四角形を描こう
ユーザー misora192
提出日時 2020-06-16 23:17:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 520 bytes
コンパイル時間 1,376 ms
コンパイル使用メモリ 166,356 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-03 12:01:42
合計ジャッジ時間 2,032 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	ll d;
	cin >> d;

	ll ans = 0;
	for(ll x = 1; (d - 2 * x) / 2 >= 1; x++){
		chmax(ans, x * ((d - 2 * x) / 2));
	}

	cout << ans << endl;
}
0