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++){ ^
代码
#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