結果

問題 No.1089 三変数方程式
ユーザー masayamatumasayamatu
提出日時 2020-06-24 22:06:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,796 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 10,452 KB
実行使用メモリ 9,032 KB
最終ジャッジ日時 2023-09-16 21:23:32
合計ジャッジ時間 12,455 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,756 KB
testcase_01 AC 19 ms
8,824 KB
testcase_02 AC 45 ms
9,016 KB
testcase_03 AC 1,004 ms
8,828 KB
testcase_04 AC 72 ms
8,900 KB
testcase_05 AC 1,796 ms
8,736 KB
testcase_06 AC 373 ms
8,960 KB
testcase_07 AC 173 ms
8,748 KB
testcase_08 AC 1,439 ms
9,032 KB
testcase_09 AC 59 ms
8,952 KB
testcase_10 AC 1,228 ms
8,712 KB
testcase_11 AC 352 ms
8,900 KB
testcase_12 AC 858 ms
8,848 KB
testcase_13 AC 353 ms
8,856 KB
testcase_14 AC 1,011 ms
8,824 KB
testcase_15 AC 1,370 ms
9,000 KB
testcase_16 AC 1,205 ms
8,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import *


n = int(input())
ans = 0

for x in range(n+1):
    for y in range(n+1-x):
        z = n - x - y
        if (z < 0) or (z > n):
            continue
        elif(x + y + z) == n:
            ans += 1
 
print(ans)      
0