結果

問題 No.80 四角形を描こう
ユーザー NoNo
提出日時 2018-01-21 17:32:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 219 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 8,328 KB
最終ジャッジ日時 2023-08-26 19:44:02
合計ジャッジ時間 1,055 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,924 KB
testcase_01 AC 14 ms
7,884 KB
testcase_02 AC 14 ms
7,908 KB
testcase_03 AC 14 ms
8,308 KB
testcase_04 WA -
testcase_05 AC 14 ms
7,984 KB
testcase_06 AC 14 ms
8,328 KB
testcase_07 AC 14 ms
8,188 KB
testcase_08 AC 15 ms
8,000 KB
testcase_09 WA -
testcase_10 AC 14 ms
8,080 KB
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

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