結果
問題 | No.80 四角形を描こう |
ユーザー |
|
提出日時 | 2017-02-19 18:20:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 301 bytes |
コンパイル時間 | 623 ms |
コンパイル使用メモリ | 53,724 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 05:12:38 |
合計ジャッジ時間 | 1,373 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 8 |
ソースコード
#include <iostream> using namespace std; int main() { int d, ans; cin >> d; if(d < 4) ans = 0; else { int x = (d - 4) /2; if(x % 2) ans = (x/2 + 2) * (x/2 + 1); else ans = (x/2 + 1) * (x/2 + 1); } cout << ans << endl; }