Notes on C++ Group B of the 18th Blue Bridge Cup Provincial Tournament

18 years of blue bridge provincial competition C++ Group B notes

Question 1: The first few days

January 1, 2000, was the first day of that year.
So, on May 4th, 2000, which day was that year?

Solution:
January 31, March 31, April 30, 2000 leap year, February 29th, January 1st is the first day

#include<iostream>
using namespace std;
int main()
{
	cout<< 31 + 29 + 31 + 30 + 4 <<endl;
	return 0;
}


Question 2: Clear code

  The glyphs of Chinese characters exist in the font library. Even today, the 16-dot font library is still widely used.
The 16-dot font library regards each Chinese character as 16x16 pixel information. And record this information in bytes.

  One byte can store 8 bits of information, and 32 bytes can store the shape of a Chinese character.
Convert each byte to binary representation, 1 means ink, 0 means background color. Each line has 2 bytes, a
total of 16 lines, the layout is:

  1st byte, 2nd byte
  3rd byte, 4th byte
   ...
  31st byte, 32nd byte

  This question is to give you a piece of information composed of multiple Chinese characters. Each Chinese character is represented by 32 bytes. The value of the byte as a signed integer is given here.

The requirements of the subject are hidden in this information. Your task is to restore the glyphs of these Chinese characters, see the requirements of the questions from them, and fill in the answers according to the requirements.

This piece of information is (a total of 10 Chinese characters):
4 0 4 0 4 0 4 32 -1 -16 4 32 4 32 4 32 4 32 4 32 8 32 8 32 16 34 16 34 32 30 -64 0
16 64 16 64 34 68 127 126 66 -124 67 4 66 4 66 -124 126 100 66 36 66 4 66 4 66 4 126 4 66 40 0 ​​16
4 0 4 0 4 0 4 32 -1 -16 4 32 4 32 4 32 4 32 4 32 8 32 8 32 16 34 16 34 32 30 -64 0
0 -128 64 -128 48 -128 17 8 1 -4 2 8 8 80 16 64 32 64 -32 64 32 -96 32 -96 33 16 34 8 36 14 40 4
4 0 3 0 1 0 0 4 -1 -2 4 0 4 16 7 -8 4 16 4 16 4 16 8 16 8 16 16 16 32 -96 64 64
16 64 20 72 62 -4 73 32 5 16 1 0 63 -8 1 0 -1 -2 0 64 0 80 63 -8 8 64 4 64 1 64 0 -128
0 16 63 -8 1 0 1 0 1 0 1 4 -1 -2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 5 0 2 0
2 0 2 0 7 -16 8 32 24 64 37 -128 2 -128 12 -128 113 -4 2 8 12 16 18 32 33 -64 1 0 14 0 112 0
1 0 1 0 1 0 9 32 9 16 17 12 17 4 33 16 65 16 1 32 1 64 0 -128 1 0 2 0 12 0 112 0
0 0 0 0 7 -16 24 24 48 12 56 12 0 56 0 -32 0 -64 0 -128 0 0 0 0 1 -128 3 -64 1 -128 0 0

answer:
According to the title information, the information given has 10 lines, and a total of 10 Chinese characters, each line has 32 numbers, 32 bytes constitute a Chinese character,
each byte, that is, the number represents an 8-bit binary number, you can Get: each 32 numbers represent 32 bytes, convert each number into 8-bit binary, pay attention to the conversion of negative numbers, and then output according to the given layout.

#include<iostream>
#include<string>
using namespace std;
void bian(int x, string& xx) {
	if (x >= 0) { //正数转二进制 
		int i=0;
		while (x > 0) {
			int b;
			b = x % 2;
			if (b == 1) {
				xx[7-i] = '1';
			}
			i++;
			x /= 2;
		}
	}
	else {	//负数转二进制 
		int i = 0;	
		xx[0] = '1';
		int j = 128 + x;/*很巧妙的地方,去掉符号位后,十进制负数+128 转换后等于二进制负数  
						例如(-1)11111111 =(127)01111111 
							 (-2) 11111110 = (126) 01111110 */ 
		 
		while (j > 0) {
			int b;
			b = j % 2;
			if (b == 1) {
				xx[7-i] = '1';
			}
			i++;
			j /= 2;
		}
	}
}
int main() {
	int i, j;
	
	
	for (j = 1; j <= 16; j++) {
		string aa = "--------", bb = "--------";
		int a, b;
		cin >> a >> b;
		bian(a, aa);
		bian(b, bb);
		cout << aa + bb << endl;
	}
	return 0; 
}


The third question: the end of the product with zero


The following 10 rows of data have 10 integers in each row. How many zeros are there at the end of their product?

5650 4542 3554 473 946 4114 3871 9073 90 4329
2758 7949 6113 5659 5245 7432 3051 4434 6704 3594
9937 1173 6866 3397 4759 7557 3070 2287 1453 9899
1486 5722 3135 1170 4014 5510 5120 729 2880 9019
2049 698 4582 4346 4427 646 9742 7340 1230 7683
5693 7015 6887 7381 4172 4341 2909 2027 7355 5649
6701 6645 1671 5978 2704 9926 295 3125 3878 6785
2066 4247 4800 1578 6652 4616 1113 6205 3264 2915
3966 5291 2904 1285 2193 1428 2265 8730 9436 7074
689 5510 8243 6114 337 4096 8199 7313 3685 211

Solution:
Mathematical approach: Because 2 * 5 = 10, decompose 100 numbers, find out how many factors of 2 and 5 are in the 100 numbers, and
finally take the minimum value to get the answer.

#include<iostream>
#include<cmath>//c++ min(a,b)需要用到这个头文件 
using namespace std;
int main()
{
	int data[]={
	5650,4542,3554,473,946,4114,3871,9073,90,4329,
	2758,7949,6113,5659,5245,7432,3051,4434,6704,3594,
	9937,1173,6866,3397,4759,7557,3070,2287,1453,9899,
	1486,5722,3135,1170,4014,5510,5120,729,2880,9019,
	2049,698,4582,4346,4427,646,9742,7340,1230,7683,
	5693,7015,6887,7381,4172,4341,2909,2027,7355,5649,
	6701,6645,1671,5978,2704,9926,295,3125,3878,6785,
	2066,4247,4800,1578,6652,4616,1113,6205,3264,2915,
	3966,5291,2904,1285,2193,1428,2265,8730,9436,7074,
	689,5510,8243,6114,337,4096,8199,7313,3685,211};
	int c2=0,c5=0;
	for(int i=0;i<100;i++)
	{
		int num=data[i];
		while(num%2==0)
		{
			c2++;
			num/=2;
		}
		while(num%5==0)
		{
			c5++;
			num/=5;
		}
	}
	cout<<min(c2,c5);
	return 0;
}


Fourth question: the number of tests


The inhabitants of Planet X have a bad temper, but fortunately, the only unusual behavior when they are angry is: dropping their mobile phones.
Major manufacturers have also launched a variety of drop-resistant mobile phones. The Quality Supervision Bureau of Planet X stipulates that mobile phones must undergo a drop resistance test and a drop resistance index is assessed before they are
allowed to be marketed and circulated.

Planet X has many towering towers, which can be used for fall resistance tests. The height of each floor of the tower is the same. What is slightly different from the earth is that their first
floor is not the ground, but is equivalent to our second floor.

If the phone is thrown from the 7th layer and it is not broken, but the 8th layer is broken, the mobile phone withstand index=7.
In particular, if the mobile phone breaks down from the first layer, the drop resistance index=0.
If the nth floor of the highest floor of the tower is not broken, then the drop resistance index = n

In order to reduce the number of tests, 3 mobile phones were sampled from each manufacturer to participate in the test.

The tower height of a certain test is 1000 floors. If we always adopt the best strategy, how many times do we need to test at most to determine the phone's drop resistance index under the worst luck?

Please fill in this maximum number of tests.

Note: What needs to be filled in is an integer, do not fill in any redundant content.


#include<iostream>
#include<climits>//包含 INT_MAX 的头文件 
using namespace std;

const int N=1000;
int f1[N+1],f2[N+1],f3[N+1];//记录手机数为1,2,3时,对应各层的测试次数
int main()
{
	//一部手机的情况 
	for(int i=1;i<=N;i++)
	{
		f1[i]=i;
	}
	//二部手机的情况 
	for(int i=1;i<=N;i++)
	{
		int ans=INT_MAX;//定义ans 为int 类型的最大值 
		//尝试1-i若干方案,最终记录所有方案中次数最小的
		for(int j=1;j<=i;j++)//在j层扔第一个手机 
		{
			//1 好的, 2坏了 
			int _max=1 + max(f2[i-j],f1[j-1]);
			ans=min(ans,_max);
		} 
		f2[i]=ans;
	}
	//三部手机的情况
	for(int i=1;i<=N;i++)
	{
		int ans=INT_MAX; 
		//尝试1-i若干方案,最终记录所有方案中次数最小的
		for(int j=1;j<=i;j++)//在j层扔第一个手机 
		{
			//1 好的, 2坏了 
			int _max=1 + max(f3[i-j],f2[j-1]);
			ans=min(ans,_max);
		} 
		f3[i]=ans;
	}
	cout<<f3[N]<<endl;
	return 0;	
} 


Question 5: Quick sort (fill in the blanks)


The following code can find the k-th smallest element from the array a[].

It uses a divide-and-conquer algorithm similar to quicksort, and the expected time complexity is O(N).

Please read and analyze the source code carefully, and fill in the missing content in the underlined part.

Solution:
a, i+1, r, k-(i-l+1)

#include <stdio.h>

int quick_select(int a[], int l, int r, int k) {
	int p = rand() % (r - l + 1) + l;
	int x = a[p];
	{int t = a[p]; a[p] = a[r]; a[r] = t;}
	int i = l, j = r;
	while(i < j) {
		while(i < j && a[i] < x) i++;
		if(i < j) {
			a[j] = a[i];
			j--;
		}
		while(i < j && a[j] > x) j--;
		if(i < j) {
			a[i] = a[j];
			i++;
		}
	}
	a[i] = x;
	p = i;
	if(i - l + 1 == k) return a[i];
	if(i - l + 1 < k) return quick_select( _____________________________ ); //填空
	else return quick_select(a, l, i - 1, k);
}
	
int main()
{
	int a[] = {1, 4, 2, 8, 5, 7, 23, 58, 16, 27, 55, 13, 26, 24, 12};
	printf("%d\n", quick_select(a, 0, 14, 5));
	return 0;
}




Question 6: Incremental triples

Given three integer arrays
A = [A1, A2,… AN],
B = [B1, B2,… BN],
C = [C1, C2,… CN],
please count how many triples (i, j, k) satisfy:

  1. 1 <= i, j, k <= N
  2. Ai < Bj < Ck

[Input format] The
first line contains an integer N.
The second line contains N integers A1, A2,… AN.
The third line contains N integers B1, B2,… BN.
The fourth line contains N integers C1, C2,… CN.

For 30% data, 1 <= N <= 100
For 60% data, 1 <= N <= 1000
For 100% data, 1 <= N <= 100000 0 <= Ai, Bi, Ci <= 100000

[Output format]
An integer represents the answer

[Sample input]
3
1 1 1
2 2 2
3 3 3

【Sample output】
27

Solution:
Range: 1 <= N <= 100000, if the triple loop brute force search will definitely time out.
After sorting the three groups of abc, for any b[i], the number of a in a smaller than b[i] * the number of c larger than b[i] is
all the increments that can be constructed by the current b[i] Tuples, which greatly shortens the time

#include<iostream>
#include<algorithm>//sort需要用到的头文件
using namespace std;
int n;
long long ans;
int main()
{
	cin>>n;
	int a[n],b[n],c[n];
	for(int i=0;i<n;i++)
		cin>>a[i];			
	for(int i=0;i<n;i++)
		cin>>b[i];	
	for(int i=0;i<n;i++)
		cin>>c[i];	
	
	sort(a,a+n);//sort排序 
	sort(b,b+n);
	sort(c,c+n);
	
	int p=0,q=0;
	for(int i=0;i<n;i++)
	{
		while(p < n && a[p] < b[i])//a 中有多少个比 b 小的 
			p++;
		while(q < n && c[q] <= b[i])//c 中大于或等于 b 的位置 
			q++;
		ans+=((long long)p*(n-q));	
	}
	cout<<ans<<endl;
	return 0;	
} 


Question 7: Spiral Polyline

The spiral polyline as shown in figure p1.png passes through all the whole points on the plane exactly once.
For the whole point (X, Y), we define its distance to the origin dis(X, Y) as the length of the spiral polyline segment from the origin to (X, Y).

For example, dis(0, 1)=3, dis(-2, -1)=9

Given the whole point coordinates (X, Y), can you calculate dis(X, Y)?
Insert picture description here
[Input format]
X and Y

For 40% data, -1000 <= X, Y <= 1000
For 70% data, -100,000 <= X, Y <= 100000
For 100% data, -1000000000 <= X, Y <= 1000000000

[Output format]
output dis(X, Y)
[sample input]
0 1

【Sample output】
3

Solution:
Take the diagonal point in the lower right corner as the reference point, measure the distance from the point to the reference point, draw the diagonal line, and find that the distance of each circle is an arithmetic sequence.
Calculate the current point after the first circle. Enter the arithmetic sum formula and add the distance to the reference point to calculate

#include<iostream>
#include<cstdlib>
#define sum(a0,n,d) (2*(a0)+((n)-1)*(d))*(n)/2	//等差数列求和公式
typedef long long LL;
using namespace std;

int main()
{
	LL x,y;
	cin>>x>>y;
	LL d=0;//距离
	LL n=0;//第几圈
	if(y>0&&abs(x)<=y)//当点落在上侧 
	{
		n=y;
		d=y-x+2*y;//距离参照点距离 
	}
	else if(x>0&&abs(y)<=x)//当点落在右侧
	{
		n=y;
		d=y+x;
	}
	else if(y<=0&&y>=x+1&&y<=-x)//当点落在下侧
	{
		n=-y;
		d=-(-y-x);
	}
	else if(x<0&&y>=x+1&&y<=-x)//当点落在左侧
	{
		n=-x-1;
		d=-(y-x-1-2*x-1);
	}
	cout<<sum(1,2*n,1)*2-d<<endl;
	return 0;
}


Question 8: Log Statistics


Xiao Ming maintains a programmers forum. Now he has collected a "like" log with N lines in total. The format of each line is:

ts id

Indicates that the post numbered id at ts time received a "like".

Now Xiao Ming wants to count which posts were once "hot posts". If a post has received no less than K likes in any time period of length D, Xiaoming thinks that the post was once a "hot post".

Specifically, if there is a certain moment T that satisfies that the post receives no less than K likes during the period of [T, T+D) (note that the left is closed and the right is open), the post was once "hot Posts".

Given a log, please help Xiaoming count all the post numbers that were once "hot posts".

[Input format] The
first line contains three integers N, D and K.
The following N lines, one log per line, contain two integers ts and id.

For 50% of the data, 1 <= K <= N <= 1000
For 100% of the data, 1 <= K <= N <= 100000 0 <= ts <= 100000 0 <= id <= 100000

[Output format]
Output hot post id in ascending order. One line per id.

[Input example]
7 10 2
0 1
0 10
10 10
10 1
9 1
100 3
100 3

【Sample output】
1
3

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define MAXLEN 100009
vector<int> a[MAXLEN];
vector<int> result;
int n, d, k, ts, id;

int main()
{
	cin>>n>>d>>k;
	for(int i=0; i<n; i++)
	{
		cin>>ts>>id;
		a[id].push_back(ts);
	}
	
	for(int i=0; i<MAXLEN; i++)
	{
		// 点赞时间从小到大排序 
		sort(a[i].begin(), a[i].end());
		// l,r指针指向开头,开始尺取 
		int l = 0;
		int r = 0;
		while(l<=r && r<a[i].size())
		{
			// 赞数够多,时间区间也满足,直接存结果 
			if(r-l+1>=k && a[i][r]-a[i][l]<d)
			{
				result.push_back(i);
				break;
			}
			// 赞数够多,但是时间区间不满足,左指针向右压缩 
			else if(r-l+1>=k && a[i][r]-a[i][l]>=d)
			{
				l += 1;
			}
			// 右指针向右推进 
			r += 1;
		}
	}
	
	for(int i=0; i<result.size(); i++)
	{
		cout<<result[i]<<endl;
	}
	return 0;
}


Question 9: Global Warming


You have a picture of a certain sea area with NxN pixels, "." means ocean, "#" means land, as shown below:

.##…
.##…
…##.
…####.
…###.

Among them, a piece of land connected in four directions "up, down, left, and right" forms an island. For example, there are 2 islands in the picture above.
As global warming has caused the sea to rise, scientists predict that in the next few decades, a pixel area on the edge of the island will be submerged by sea water. Specifically, if a land pixel is adjacent to the ocean (there is an ocean among the four adjacent pixels up, down, left, and right), it will be submerged.
For example in the figure above sea will become the future looks as follows:
...
...
...
...
... # ...
...
...

Please calculate: According to the prediction of scientists, how many islands in the photo will be completely submerged.

[Input format] The
first line contains an integer N. (1 <= N <= 1000)

The following N rows and N columns represent a picture of the sea area.

The picture guarantees that the pixels in the first row, the first column, the Nth row, and the Nth column are all oceans.

[Output format]

An integer represents the answer

Problem solution:
depth first search

#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<queue>
using namespace std;

int N,ans;// N规模,ans答案

int da[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};

char data[1000][1000];
int mark[1000][1000];

//自定义point类型,存储一个格子的横纵坐标
struct Point{
	int x,y;
}; 
void bfs(int i,int j) {
	mark[i][j] = 1;//标记为已访问
	queue<Point> q;//新建一个队列
	q.push({i,j});//将当前格子封装到point,插入队列
	int cnt1=0,cnt2=0;//分别记录当前这个块的#的数量以及和 .相邻#的数量
	while(!q.empty()){
		Point first=q.front();
		q.pop();
		cnt1++;
		bool swed=false;//标记弹出的#周围是否有.
		//向四周探查
		for(int k=0;k<4;k++)
		{
			int x = first.x+da[k];
			int y = first.y+dy[k];
			if(0<=x && x<N && 0<=y && y<N &&data[x][y]=='.' )swed=true;
			//周边的#如果未被访问,将其加入队列 
			if(0<=x && x<N && 0<=y && y<N &&data[x][y]=='#'&&mark[x][y]==0 )
			{
				q.push({x, y});
				mark[x][y]=1;
			}
		} 
		if(swed)
			cnt2++;
	} 
//	//一个连通块就被访问完了,块中#的记录在cnt1,周边有.的#的数量记录在cnt2 
	if(cnt1==cnt2) ans++;
}
void work(){
	//读入大量字符,所以这里采用快速配置 
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> N;//读取规模
	//读换行符
	char next;
	cin.get(next);
	while(next!='\n')cin.get(next);
	//双循环读地图数据
	for(int i=0;i<N;i++) {
		for (int j=0;j<N;j++) {
			cin.get(data[i][j]);
		}
		//读取换行符
		cin.get(next);
		while(next!='\n')cin.get(next);
	} 
	//双循环检验#,从#开始宽度优先搜索
	for(int i=0;i<N;i++) {
		for(int j=0;j<N;j++) {
			if(mark[i][j]==0&&data[i][j]=='#') {
				bfs(i,j);
			}
		}
	} 
	cout<<ans<<endl;
}
int main(){
	work();
	return 0;
}


Question 10: Maximum product


Given N integers A1, A2,… AN. Please select K numbers among them to maximize their product.

Please find the largest product, because the product may exceed the integer range, you only need to output the remainder of the product divided by 1000000009.

Note that if X<0, we define the remainder of X divided by 1000000009 to be the remainder of negative (-X) divided by 1000000009.
That is: 0-((0-x)% 1000000009)

[Input format] The
first line contains two integers N and K.
Each of the following N lines has an integer Ai.

For 40% data, 1 <= K <= N <= 100
For 60% data, 1 <= K <= 1000
For 100% data, 1 <= K <= N <= 100000 -100000 <= Ai <= 100000

[Output format]
An integer, representing the answer.

[Input example]
5 3
-100000
-10000
2
100000
10000

【Sample output】
999100009

Another example:
[input example]
5 3
-100000
-100000
-2
-100000
-100000

【Output sample】
-999999829

#include<iostream>
using namespace std;
int main()
{
	cout<< 31 + 29 + 31 + 30 + 4 <<#include<iostream>
#include<map>
#include<string>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<climits>

typedef long long LL;
using namespace std;

const long long MOD = 1000000009;
const int maxN = 100005;
int n, k;
vector<LL> pos, neg;  //保存正数和负数的列表
LL ans;

/**
* .将数组a中[start, end]区间内的数连乘起来
* @param a
* @param start
* @param end
* @param flag
* @return
*/
LL mul(vector<LL> a, int start, int end) {
    LL ans=1;
	
	for (int i = start; i <= end; ++i) {
	    ans=ans*a[i]%MOD;
	}
	return ans;
	}
	
void work() {
    cin>>n>>k;
    for (int i=1;i<=n;i++){
    	LL x;
    	cin >> x;
    	if (x > 0)pos.push_back(x);
  	    if (x < 0)neg.push_back(x);  //只处理正数和负数, 0不处理
  	}
	sort(pos.begin(), pos.end());
	sort(neg.begin(), neg.end());
/*=========下面开始分类讨论========*/
    unsigned long sizeSum = pos.size() + neg.size();
    //1.正数和负数的个数不足k ,必然有0的存在
    if (sizeSum < k) {
        ans = 0;
    }
	//2.正数和负数的个数恰好为k
    else if (sizeSum == k) {
        //2.1 k与n相等,必须选这k个数,没有0
	    if (k==n){
	        ans = mul(pos, start:0, end::pos.size() - 1) * mul((neg, start):0, end::neg.size() - 1) %MOD;
		} 
        //2.2 k<n ,有0的存在
        else { 
        //2.2.1可得正数解当且仅当:正数全部选中,负数全部选中且为偶数个
            if (neg.size()%2 == 0){
                ans = mul(pos, start: 0, end::pos.size() -1) * mul((neg, start):0, end::neg.size() -1) % MOD;
            } else {
            //2.2.2负数是奇数个,全部选中结果为负数,不全部选中可得0 ,结果就是0
	            ans = 0;
            }
        }
	}else{
    //3.正数和负数的个数大于k ,情况比较复杂
    //sum>k
    //3.1没有正数,负数和0中选k个
    	if (pos.size() == 0) {
 	        if(k%2==0){//3.1.1k是偶数.
	           ans = mul(neg, start:0, end::k - 1);  //正向选k个
      	} else {  //3.1.2 k是奇数
	        if (sizeSum < n)    //有0
			    ans = 0;
		    else//没有0 ,必须从所有负数中选奇数个数=》连乘绝对值小的
			    ans = mul(neg, start::neg.size() - k, end::neg.size() - 1);  //逆向选k个
    //3.2没有负数
	} }else if (neg.size() == 0) {
	    ans = mul(pos, star::pos.size() - k, end::pos.size() - 1);//逆向选k个
    //3.3有正数也有负数
	} else {
	    int posStart;
    	int negEnd;
	    if (k >= pos.size()) {  //3.3.1 正数不足k个
    //假定正数全部选中, 剩余偶数个负数,等 会再来挪动标尺
      	    if ((k - pos.size()) % 2 == 0) {
	            negEnd = k - pos.size() - 1;//负数选择的截止下标
	            posStart = 0;//正数选择的起始下标
  	        } else {
    //剩余个数是奇数,正数先少选一个
	            posStart = 1;//正数选择的起始下标
	            negEnd = k - pos.size();//负数选择的截止下标
            }
            } else {   //正数多余k个,假定从正数中先选最大的k个
            //if(k%2==0){ //k是偶数
                negEnd = -1;
                posStart = pos.size() - k;
                //}else{//k是奇数,先少选一个
                    //negEnd=-1;
                    //posStart = pos.size()-1-k;
                //}
                }
            //双标尺移动
            while (negEnd + 2 < neg.size() && posStart + 2 < pos.size() &&
                   neg[negEnd + 1] * neg[negEnd + 2] > pos[posStart] * pos[posStart + 1]) {
                negEnd += 2;
                posStart += 2;
                }
            ans = mul(neg, start:0, negEnd) * mul(pos, posStart, end::pos.size() - 1) % MOD;
        }
    }
	cout << ans << endl;
}

int main() {
//work();
    cout << 1LL * 100000 * 100000 % MOD * 10000 % MOD << endl;
    cout << -2LL * 100000 * 100000 % MOD << endl;
	return 0;
}endl;
	return 0;
}

Guess you like

Origin blog.csdn.net/qq_45934504/article/details/113882899
Recommended