记录详情

Wrong Answer

/in/foo.cc: In function 'int main()':
/in/foo.cc:11:14: warning: unused variable 'rec' [-Wunused-variable]
  ll ans = 1, rec = 0;
              ^~~
# 状态 耗时 内存占用
#1 Accepted 1ms 208.0 KiB
#2 Wrong Answer 1ms 232.0 KiB
#3 Wrong Answer 1ms 216.0 KiB
#4 Wrong Answer 1ms 232.0 KiB
#5 Wrong Answer 1ms 220.0 KiB
#6 Wrong Answer 1ms 228.0 KiB
#7 Wrong Answer 1ms 220.0 KiB
#8 Wrong Answer 1ms 232.0 KiB
#9 Wrong Answer 1ms 220.0 KiB
#10 Wrong Answer 1ms 228.0 KiB

代码

#include <cmath>
#include <iostream> 
//after
typedef long long ll;
const ll P = 1000000007;
ll n, prime[ll(1e5)], top;
bool notPrime[ll(1e5)];
int main(){
	std::cin >> n;
	ll limit = std::min(ll(sqrt(n) + 10), n);
	ll ans = 1, rec = 0;
	for(int i = 2 ; i <= limit ; ++i){
		if(!notPrime[i])
			prime[++top] = i;
		for(int j = 1 ; prime[j] * i <= limit && j <= top; ++j){
			notPrime[prime[j] * i] = true;
		}
	}
	for(int i = 1 ; prime[i] <= n && i <= top; ++i ){
		ll temp = prime[i];
		while(temp * prime[i] <= n) 
			temp *= prime[i];
		ans = (ans * (temp % P)) % P;
	}
	std::cout << ans;
	return 0;
}

信息

递交者
类型
递交
题目
篝题
语言
C++
递交时间
2020-12-23 11:23:15
评测时间
2020-12-23 11:23:15
评测机
分数
10
总耗时
15ms
峰值内存
232.0 KiB