记录详情

Wrong Answer

/in/foo.cc: In function 'int main()':
/in/foo.cc:19:20: warning: unused variable 'y' [-Wunused-variable]
  for(int i = 1, x, y; i <= cnt; i++){
                    ^
# 状态 耗时 内存占用
#1 Accepted 3ms 2.266 MiB
#2 Accepted 1ms 2.344 MiB
#3 Accepted 3ms 2.352 MiB
#4 Wrong Answer 7ms 2.75 MiB
#5 Wrong Answer 9ms 4.875 MiB
#6 Wrong Answer 8ms 4.625 MiB
#7 Wrong Answer 11ms 4.625 MiB
#8 Wrong Answer 14ms 5.246 MiB
#9 Wrong Answer 7ms 2.59 MiB
#10 Wrong Answer 6ms 4.473 MiB

代码

#include <bits/stdc++.h>
#define N 100000020
#define mod 100000007
using namespace std;
int n, pri[6000000], cnt, ans = 1;
bool mark[N];
void getPri(int x){
	for(int i = 2; i <= x; i++){
		if(!mark[i])pri[++cnt]=i;
		for(int j = 1; j <= cnt && pri[j]*i <= x; j++){
			mark[pri[j]*i] = 1;
			if(i%pri[j]==0)break;
		}
	}
}
int main(){
	scanf("%d", &n);
	getPri(n);
	for(int i = 1, x, y; i <= cnt; i++){
		x = pri[i];
		while(x*pri[i] <= n) x*=pri[i];
		ans = (long long)ans*x%mod;
	}
	printf("%d\n", ans);
}

信息

递交者
类型
递交
题目
篝题
语言
C++
递交时间
2017-05-02 07:55:19
评测时间
2017-05-02 07:55:19
评测机
分数
30
总耗时
74ms
峰值内存
5.246 MiB