小P的疑惑

小P的疑惑

题解,很明显,可以推出,k(n)=n^{2}

源码

#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
const LL mo=10000007;
LL q,n;
#define gc() getchar()
template<typename _T>
inline void read(_T &x)
{
    _T f=1;x=0;char s=gc();
    while(s>'9'||s<'0'){if(s=='-')f=-1;s=gc();}
    while(s>='0'&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=gc();}
    x*=f;
}
int main()
{
	freopen("puzzle.in","r",stdin);
	freopen("puzzle.out","w",stdout);
	read(q);
	while(q--)
	{
		read(n);
		printf("%lld\n",n*n%mo);
	}
    return 0;
}

谢谢!!!

posted @ 2019-11-09 17:26  StaroForgin  阅读(11)  评论(0)    收藏  举报  来源