血的教训,在计算中间结果的时候也要用long long保存,不然结果会溢出!!! 附上C++二分查找代码 #include <iostream> #include <vector> using namespace std; class Solution2 { public: int N, D; int mod = 99997867; &...