记录详情

Wrong Answer

/in/foo.cc: In function 'int main()':
/in/foo.cc:49:19: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
  printf("%d\n",ans);
                   ^
# 状态 耗时 内存占用
#1 Accepted 1ms 2.25 MiB
#2 Accepted 3ms 2.348 MiB
#3 Accepted 3ms 2.375 MiB
#4 Accepted 2ms 2.375 MiB
#5 Accepted 4ms 2.375 MiB
#6 Wrong Answer 847ms 118.629 MiB
#7 Wrong Answer 558ms 82.5 MiB
#8 Wrong Answer 822ms 119.25 MiB
#9 Wrong Answer 781ms 116.0 MiB
#10 Wrong Answer 484ms 74.0 MiB

代码

#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cstring>
#include<vector>
#define inf 1e9
#define ll long long
#define For(i,j,k) for(int i=j;i<=k;i++)
#define Dow(i,j,k) for(int i=k;i>=j;i--)
using namespace std;
int mo=1000000007;
int n,tot,pri[10000001];
ll ans;
bool bj[100000001];
inline void get_pri()
{
	For(i,2,n)
	{
		if(!bj[i])	
			pri[++tot]=i;
		For(j,1,tot)
		{
			if(i*pri[j]>n)	break;
			bj[i*pri[j]]=1;
			if(i%pri[j]==0)	break;
		}
	}
}
inline int ksm(int x,int y)
{
	int sum=1;for(;y;y>>=1){if(y&1)sum=sum*x;x=x*x;}	return sum;
}
int main()
{
	scanf("%d",&n);
	get_pri();
	ans=1;
	For(i,1,tot)
	{
		int  num=pri[i];
		int tmp=num;
		while(tmp*num<=n)	tmp=(ll)tmp*num;
		ans=((ll)ans*tmp)%(ll)mo;
	}
	printf("%d\n",ans);
}

信息

递交者
类型
递交
题目
篝题
语言
C++
递交时间
2017-05-02 11:02:19
评测时间
2017-05-02 11:02:19
评测机
分数
50
总耗时
3511ms
峰值内存
119.25 MiB