結果
| 問題 |
No.3179 3 time mod
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-15 15:54:47 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 70 ms / 2,000 ms |
| コード長 | 953 bytes |
| コンパイル時間 | 870 ms |
| コンパイル使用メモリ | 82,944 KB |
| 実行使用メモリ | 70,192 KB |
| 最終ジャッジ日時 | 2025-06-15 15:54:53 |
| 合計ジャッジ時間 | 5,361 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 42 |
ソースコード
from collections import Counter, deque, defaultdict
from heapq import heapify, heappop, heappush, nlargest, nsmallest
from bisect import bisect_left, bisect, bisect_right
from copy import deepcopy
from time import perf_counter
import sys
from typing import Any, List, Callable
def debug(*args, sep=" ", end="\n") -> None:
print(*args, sep=sep, end=end, file=sys.stderr)
def main():
global inf, MOD
input = sys.stdin.read().split()
ptr = 0
inf = float("inf")
MOD = 998244353
N = int(input[ptr]); ptr += 1
P, Q, R = map(int, input[ptr:ptr + 3]); ptr += 3
A, B, C = map(int, input[ptr:ptr + 3]); ptr += 3
AA = A * pow(Q * R, -1, mod=P); AA %= P
BB = B * pow(R * P, -1, mod=Q); BB %= Q
CC = C * pow(P * Q, -1, mod=R); CC %= R
S = CC * P * Q + AA * Q * R + BB * R * P; S %= P * Q * R
ans = (N - S) // (P * Q * R) + 1
print(ans)
debug(S, AA, BB, CC)
if __name__ == "__main__":
main()