結果

問題 No.1756 Rider's Triangle
ユーザー koba-e964koba-e964
提出日時 2021-11-20 19:03:06
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 406 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 79,156 KB
最終ジャッジ日時 2023-09-02 15:12:02
合計ジャッジ時間 3,919 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,468 KB
testcase_01 AC 78 ms
71,132 KB
testcase_02 RE -
testcase_03 AC 77 ms
71,088 KB
testcase_04 AC 76 ms
71,240 KB
testcase_05 AC 77 ms
71,232 KB
testcase_06 AC 77 ms
71,460 KB
testcase_07 AC 78 ms
71,208 KB
testcase_08 AC 79 ms
71,344 KB
testcase_09 AC 76 ms
71,132 KB
testcase_10 AC 74 ms
71,428 KB
testcase_11 AC 78 ms
71,236 KB
testcase_12 AC 79 ms
71,364 KB
testcase_13 AC 78 ms
71,368 KB
testcase_14 AC 78 ms
71,480 KB
testcase_15 AC 78 ms
71,168 KB
testcase_16 AC 79 ms
71,356 KB
testcase_17 AC 82 ms
71,240 KB
testcase_18 AC 80 ms
71,208 KB
testcase_19 AC 76 ms
71,372 KB
testcase_20 AC 75 ms
71,476 KB
testcase_21 AC 77 ms
71,076 KB
testcase_22 AC 76 ms
71,136 KB
testcase_23 AC 76 ms
71,320 KB
testcase_24 AC 78 ms
71,136 KB
testcase_25 AC 76 ms
70,932 KB
testcase_26 AC 76 ms
71,452 KB
testcase_27 AC 74 ms
71,476 KB
testcase_28 AC 79 ms
71,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

def gcd(x, y):
    while y != 0:
        r = x % y
        x = y
        y = r
    return x


a, b, n = map(int, input().split())
g = gcd(2 * a * b, b * b - a * a)
c = 2 * a * b // g
d = (b * b - a * a) // g

if c == 0 or d == 0:
    print(0)
    exit()

tot = 0

x = max(a * d, b * c)
y = a * c + b * d

if x < n and y < n:
    tot += (n - x) * (n - y) * 8

print(tot % 998244353)
0