/ Randle /

记录详情

Runtime Error

/in/foo.cc: In function 'long long int work(long long int, long long int)':
/in/foo.cc:4:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  if(i==j)return i;long long k=j,l=i-j;
  ^~
/in/foo.cc:4:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  if(i==j)return i;long long k=j,l=i-j;
                   ^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:10:28: warning: unused variable 's' [-Wunused-variable]
  long long n,m,restn,restm,s;
                            ^
# 状态 耗时 内存占用
#1 Wrong Answer 2ms 312.0 KiB
#2 Wrong Answer 2ms 316.0 KiB
#3 Wrong Answer 2ms 312.0 KiB
#4 Wrong Answer 1ms 308.0 KiB
#5 Runtime Error 6ms 8.305 MiB
#6 Runtime Error 5ms 8.301 MiB
#7 Wrong Answer 1ms 312.0 KiB
#8 Wrong Answer 1ms 316.0 KiB
#9 Runtime Error 5ms 8.297 MiB
#10 Runtime Error 6ms 8.297 MiB

代码

#include<bits/stdc++.h>
long long work(long long i,long long j)
{
	if(i==j)return i;long long k=j,l=i-j;
	if(k<l)std::swap(k,l);
	return j+work(k,l);
}
int main()
{
	long long 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:53:27
评测时间
2017-10-05 17:53:27
评测机
分数
0
总耗时
35ms
峰值内存
8.305 MiB