记录详情

Wrong Answer

/in/foo.cc: In function 'int main()':
/in/foo.cc:46:3: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   while(tmp<=n) tmp*=num;tmp/=num;
   ^~~~~
/in/foo.cc:46:26: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'while'
   while(tmp<=n) tmp*=num;tmp/=num;
                          ^~~
/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 4ms 2.25 MiB
#2 Accepted 3ms 2.25 MiB
#3 Accepted 3ms 2.25 MiB
#4 Accepted 3ms 2.25 MiB
#5 Accepted 2ms 2.25 MiB
#6 Wrong Answer 847ms 119.25 MiB
#7 Wrong Answer 560ms 80.75 MiB
#8 Wrong Answer 841ms 117.875 MiB
#9 Wrong Answer 789ms 116.375 MiB
#10 Wrong Answer 498ms 72.855 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<=n)	tmp*=num;tmp/=num;
		ans=((ll)ans*tmp)%(ll)mo;
	}
	printf("%d\n",ans);
}

信息

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