結果

問題 No.1756 Rider's Triangle
ユーザー koba-e964koba-e964
提出日時 2021-11-20 18:21:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 398 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 78,840 KB
最終ジャッジ日時 2023-09-02 14:16:48
合計ジャッジ時間 3,956 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 72 ms
71,224 KB
testcase_02 RE -
testcase_03 WA -
testcase_04 AC 71 ms
71,088 KB
testcase_05 AC 70 ms
71,060 KB
testcase_06 AC 73 ms
71,248 KB
testcase_07 AC 72 ms
70,992 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

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
x = a * c - b * d
y = a * d + b * c
x = a * c - max(x, 0)

if c == 0 or d == 0 or x >= n or y >= n:
    print(0)
    exit()

print((n - x) * (n - y) * 8 % 998244353)
0