取模

#include<bits/stdc++.h>

using namespace std;

const int mo = 1000000007;

inline void inc(int &a,int b)
{
	a+=b;if (a>=mo) a-=mo;
}
#define inc(a,b) {a+=b;if (a>=mo) a-=mo;}

int main()
{
	res.sum = (1ll * res.sum * mul + 1ll * add * res.size) % mo;
	
	//a = b+c*d;
	a = (b + 1ll * c * d) % mo;
	
	//a = b*c*d + e*f + g;
	a = (1ll * b * c % mo * d + 1ll * e * f + g) % mo;
	
	//a = a + b;
	a += b; if (a >= mo) a-=mo;
	
	//a = b*c-d*e
	a = ((1ll * b * c - 1ll * d * e) % mo + mo) % mo;
	
	//a = a - b
	a -= b; if (a<0) a += mo;
	
	return 0;
}
posted @ 2025-06-21 20:41  Fire_poetry  阅读(9)  评论(0)    收藏  举报