记录详情

Accepted

/in/foo.cc: In function 'int main()':
/in/foo.cc:45:19: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
  printf("%d\n",ans);
                   ^
# 状态 耗时 内存占用
#1 Accepted 3ms 2.25 MiB
#2 Accepted 3ms 2.25 MiB
#3 Accepted 3ms 2.375 MiB
#4 Accepted 3ms 2.34 MiB
#5 Accepted 3ms 2.25 MiB
#6 Accepted 804ms 118.125 MiB
#7 Accepted 540ms 81.375 MiB
#8 Accepted 856ms 117.75 MiB
#9 Accepted 783ms 113.223 MiB
#10 Accepted 482ms 71.617 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;
		}
	}
}
int main()
{
	scanf("%d",&n);
	get_pri();
	ans=1;
	For(i,1,tot)
	{
		int  num=pri[i];
		ll tmp=1;
		while(tmp*num<=n)	tmp*=num;
		ans=((ll)ans*tmp)%(ll)mo;
	}
	printf("%d\n",ans);
}

信息

递交者
类型
递交
题目
篝题
语言
C++
递交时间
2017-05-02 11:03:58
评测时间
2017-05-02 11:03:58
评测机
分数
100
总耗时
3484ms
峰值内存
118.125 MiB