记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Time Exceeded ≥1001ms ≥95.766 MiB
#2 Time Exceeded ≥1000ms ≥96.777 MiB
#3 Time Exceeded ≥1000ms ≥97.523 MiB
#4 Time Exceeded ≥1001ms ≥97.426 MiB
#5 Time Exceeded ≥1002ms ≥95.715 MiB
#6 Time Exceeded ≥1001ms ≥97.492 MiB
#7 Time Exceeded ≥1000ms ≥95.941 MiB
#8 Time Exceeded ≥1002ms ≥96.621 MiB
#9 Time Exceeded ≥1002ms ≥97.449 MiB
#10 Time Exceeded ≥1004ms ≥97.414 MiB

代码

#include <cmath>
#include <iostream> 
//after
typedef long long ll;
const ll P = 1000000007;
ll n, prime[ll(1e8) + 10], top;
bool notPrime[ll(1e8) + 10];
int main(){
	std::cin >> n;
	ll limit = ll(1e8);
	ll ans = 1;
	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:36:44
评测时间
2020-12-23 11:36:44
评测机
分数
0
总耗时
≥10018ms
峰值内存
≥97.523 MiB