摘要:
Olympiad Olympiad 输出除0以外的数字种数即可。 Vile Grasshoppers Vile Grasshoppers 猜想答案离y不会很远。暴力枚举答案, $O(\sqrt n)$验证,如果有因数落在区间$[2,p]$里就不合法。 Save Energy! Save Energy 阅读全文
摘要:
传送门 主要问题是怎么求$a^b \ mod \ c$。 可以用欧拉定理降幂。 $$a^b \ mod \ c = a ^ {b \% \varphi(c) } \; mod \ c (b < \varphi(c))$$ $$a^b \ mod \ c = a ^ {b \% \varphi(c) 阅读全文
摘要:
Educational Codeforces Round 36 (Rated for Div. 2) F. Imbalance Value of a Tree You are given a tree T consisting of n vertices. A number is written o 阅读全文