小X的密码破译
.
.
.
.
.
程序:

#include<iostream>
#include<cstdio>
using namespace std;
bool f[11111112];
int main()
{
	int a,b,c,n,x=11111111;
	scanf("%d%d%d%d",&n,&a,&b,&c);
	for (int i=1;i<=n;i++)
		f[((long long)a*i*i+b*i+c)%x]=true;
	int ans=0;
	int tj=0;
	for (int i=0;i<x;i++)
	if (f[i]==true)
	{
		tj++;
		ans=((long long)tj*i+ans)%x;
	}
	printf("%d",ans);
	return 0;
}

相关文章:

  • 2022-12-23
  • 2021-10-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-11
  • 2022-12-23
猜你喜欢
  • 2021-11-24
  • 2022-02-09
  • 2021-09-04
  • 2021-11-11
  • 2021-07-17
相关资源
相似解决方案