結果

問題 No.80 四角形を描こう
ユーザー No
提出日時 2018-01-21 17:32:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 219 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-25 21:21:57
合計ジャッジ時間 1,843 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 5 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math

d = int(input())
if d < 4:
    print(0)
    sys.exit()
    
if d % 2 == 1:
    d -= 1

if d % 4 == 0:
    ans = pow(d / 4,2)
else:
    a = int(math.sqrt(d))
    ans = a * (a + 1)

print(int(ans))
0