結果
| 問題 |
No.80 四角形を描こう
|
| コンテスト | |
| ユーザー |
moti
|
| 提出日時 | 2020-03-08 15:03:23 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 434 bytes |
| コンパイル時間 | 1,997 ms |
| コンパイル使用メモリ | 162,536 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-30 16:52:36 |
| 合計ジャッジ時間 | 2,488 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 8 |
コンパイルメッセージ
main.cpp:11:20: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
11 | long long mx = -1<<29;
| ~~^
1 warning generated.
ソースコード
#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;
}
moti