結果
問題 |
No.2847 Birthday Attack
|
ユーザー |
|
提出日時 | 2024-08-23 22:11:59 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 585 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 82,380 KB |
実行使用メモリ | 63,832 KB |
最終ジャッジ日時 | 2024-08-23 22:12:02 |
合計ジャッジ時間 | 1,862 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | WA * 14 |
ソースコード
from math import gcd import sys, time, random from collections import deque, Counter, defaultdict def debug(*x):print('debug:',*x, file=sys.stderr) input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 61 - 1 x, y, mod = mi() ans = 0 #縦 cnt = 0 for i in range(1, x + 1): if 2 * i > x: break cnt += (x - 2 * i) ans += 2 * y * cnt ans %= mod #横 cnt = 0 for i in range(1, y + 1): if 2 * i > y: break cnt += (y - 2 * i) ans += 2 * x * cnt ans %= mod print(ans)