/ tabris /

记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Wrong Answer 2ms 304.0 KiB
#2 Wrong Answer 1ms 204.0 KiB
#3 Wrong Answer 2ms 220.0 KiB
#4 Wrong Answer 2ms 220.0 KiB
#5 Wrong Answer 2ms 216.0 KiB
#6 Wrong Answer 2ms 300.0 KiB
#7 Wrong Answer 3ms 208.0 KiB
#8 Wrong Answer 104ms 220.0 KiB
#9 Time Exceeded ≥1003ms ≥300.0 KiB
#10 Time Exceeded ≥1005ms ≥300.0 KiB

代码

#include<stdio.h>
#include<algorithm>
using namespace std;
int f(int n)
{
	int ans = 0;
	for(int i = n;i >= 1;--i)
	{
		if(n % i == 0)
			++ans;
	}
	return ans;
}
int m(int n)
{
	int ans = 0;
	if(n == 1)
		return 1;
	else
	{
		for(int j = n;j >= 2;--j)
		{
			if(n % j == 0)
				ans = ans + f(j)*m(n / j);
		}
	}
	return ans;
	
}
int main()
{
	int T, n;
	scanf("%d", &T);
	while(T--)
	{
		scanf("%d", &n);
		printf("%d\n", -1*m(n));
	}
	return 0;
 } 

信息

递交者
类型
递交
语言
C++
递交时间
2019-06-11 13:30:51
评测时间
2019-06-11 13:30:52
评测机
分数
0
总耗时
≥2130ms
峰值内存
≥304.0 KiB