/ Randle /

记录详情

Time Exceeded

/in/foo.cc: In function 'int main()':
/in/foo.cc:9:22: warning: unused variable 's' [-Wunused-variable]
  int n,m,restn,restm,s;
                      ^
# 状态 耗时 内存占用
#1 Time Exceeded ≥1007ms ≥308.0 KiB
#2 Time Exceeded ≥1006ms ≥324.0 KiB
#3 Time Exceeded ≥1006ms ≥316.0 KiB
#4 Time Exceeded ≥1006ms ≥312.0 KiB
#5 Time Exceeded ≥1006ms ≥316.0 KiB
#6 Wrong Answer 547ms 316.0 KiB
#7 Wrong Answer 3ms 316.0 KiB
#8 Wrong Answer 3ms 312.0 KiB
#9 Time Exceeded ≥1007ms ≥312.0 KiB
#10 Time Exceeded ≥1007ms ≥312.0 KiB

代码

#include<bits/stdc++.h>
int work(int i,int j)
{
	if(i==j)return i;
	return j+work(j,i-j);
}
int main()
{
	int n,m,restn,restm,s;
	std::cin>>n>>m;
	restn=n/3;if(restn*3<n)restn++;
	restm=m/3;if(restm*3<m)restm++;
	std::cout<<std::max(m*work(n-restn,restn),n*work(m-restm,restm));
	return 0;	
} 

信息

递交者
类型
递交
题目
切蛋糕 T1
题目数据
下载
语言
C++
递交时间
2017-10-05 17:47:58
评测时间
2017-10-05 17:48:00
评测机
分数
0
总耗时
≥7603ms
峰值内存
≥324.0 KiB