結果
問題 | No.1756 Rider's Triangle |
ユーザー |
|
提出日時 | 2021-11-20 18:34:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 537 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 82,348 KB |
実行使用メモリ | 65,732 KB |
最終ジャッジ日時 | 2024-06-11 21:11:24 |
合計ジャッジ時間 | 2,066 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 RE * 1 |
other | AC * 4 WA * 21 |
ソースコード
#!/usr/bin/env python3def gcd(x, y):while y != 0:r = x % yx = yy = rreturn xa, b, n = map(int, input().split())g = gcd(2 * a * b, b * b - a * a)c = 2 * a * b // gd = (b * b - a * a) // gif c == 0 or d == 0:print(0)exit()tot = 0x = a * c - b * dy = a * d + b * cx = a * c - max(x, 0)if x < n and y < n:tot += (n - x) * (n - y) * 4x = b * c - a * dy = b * d + a * cx = b * c - min(x, 0)if x < n and y < n:tot += (n - x) * (n - y) * 4print(tot % 998244353)