/ Randle /

记录详情

Time Exceeded

/in/foo.cc: In function 'int main()':
/in/foo.cc:24:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   for(int j=1;j=m;j++)
               ~^~
/in/foo.cc:22:9: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized]
   int c,b,MAX=0;
         ^
/in/foo.cc:22:7: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
   int c,b,MAX=0;
       ^
# 状态 耗时 内存占用
#1 Time Exceeded ≥1007ms ≥312.0 KiB
#2 Time Exceeded ≥1007ms ≥324.0 KiB
#3 Time Exceeded ≥1006ms ≥440.0 KiB
#4 Time Exceeded ≥1006ms ≥432.0 KiB
#5 Time Exceeded ≥1006ms ≥312.0 KiB
#6 Time Exceeded ≥1002ms ≥436.0 KiB
#7 Time Exceeded ≥1006ms ≥312.0 KiB
#8 Time Exceeded ≥1004ms ≥324.0 KiB
#9 Time Exceeded ≥1006ms ≥440.0 KiB
#10 Time Exceeded ≥1004ms ≥308.0 KiB

代码

#include<bits/stdc++.h>
using namespace std;
int sum[10001],a[10001],ans[1001];
int n,m,t;
inline const void read(int &x)
{
	x=0;
	char c=getchar();
	while(c>'9'||c<'0')
	c=getchar();
	while(c>='0'&&c<='9')
	{
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
}
int main()
{
	read(n);read(m);read(t);
	for(int i=1;i<=n;i++)
	{
		int c,b,MAX=0;
		memset(sum,0,sizeof(sum));
		for(int j=1;j=m;j++)
		{
			read(a[j]);
			sum[j]+=a[j];
		}
		for(int j=1;j<=m-t+1;j++)
		{
			for(int k=1;k<=t;k++)
			{
				int temp=sum[j+k-1]-sum[j-1];
				if(temp>MAX)
				{
					c=j;
					b=j+k-1;
				}
			}
		}
		for(int j=c;j<=b;j++)
			ans[j]++;
	}
	for(int i=1;i<=m;i++)
	cout<<ans[i]<<' ';
	cout<<endl;
	return 0;
}

信息

递交者
类型
递交
题目
骂战(原创)
题目数据
下载
语言
C++
递交时间
2017-10-12 09:07:05
评测时间
2017-10-12 09:07:05
评测机
分数
0
总耗时
≥10059ms
峰值内存
≥440.0 KiB