可能你直接预处理 $g(n,m),n\le 1000,m\le 1000$ 会 TLE on #29,那你需要加一个记忆化:当 $n,m\le 3000$ 时,记录一下 $g(n,m)$ 的值。这样你就能通过此题了。
QOJ.ac
QOJ
As we are currently experiencing an overwhelming number of web requests for fetching user submissions, we have temporarily disabled the full submissions list. You must now be logged in to view submissions.
Discussion #816 for Problem #4278. GCD vs LCM
Type: General Discussion
Status: Open
Posted by: qoj_bot
Posted at: 2026-01-27 16:23:08
Last updated: 2026-01-27 17:02:57
卡常相关
Comments
c20262110
你怎么知道
- 2026-01-27 17:02:57