[网游计划第十一、十二天] 放弃才有出路
不得不放弃,第十一天,全天在做一道“简单题”,说是简单题,因为过程很明确:统计一个房间里所有电器的用电量,每个电器时开时关,由输入给定。
但是做了一整天,却离AC越来越远,开始是runtime erroe,逐段提交代码,发现是接受输入时的上限不够,这很奇怪,因为题目中说的是:(n <= 20)。可当我将数组改为2000时,判题结果变TL了,可恶!居然给题目给骗了!
可是情况并没有好转,TL代替runtime erroe成了挥之不去的阴影,屡次优化失败后(包括去掉函数调用、更严格的循环控制,去掉if中的运算),再次使用逐段提交的办法,结果令我有些愤怒了,请看一下代码:
#include <stdio.h>
#include <string.h>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
int Devices[2001];
int on_off[201];
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
int main()
{
int n = 0,m = 0,c = 0;
int SequenceNo = 0,in = 0,im = 0;
int MaxPower = 0,TempPower = 0,flag = 0;
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
while(scanf("%d%d%d",&n,&m,&c) && n!=0 && m!=0 && c!=0)
{
memset(on_off,0,sizeof(on_off));
SequenceNo++;
for(in=1;in<=n;in++)
{
scanf("%d",&Devices[in]);
}
printf("u are a pig!");
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
return 0;
}
但是做了一整天,却离AC越来越远,开始是runtime erroe,逐段提交代码,发现是接受输入时的上限不够,这很奇怪,因为题目中说的是:(n <= 20)。可当我将数组改为2000时,判题结果变TL了,可恶!居然给题目给骗了!
可是情况并没有好转,TL代替runtime erroe成了挥之不去的阴影,屡次优化失败后(包括去掉函数调用、更严格的循环控制,去掉if中的运算),再次使用逐段提交的办法,结果令我有些愤怒了,请看一下代码:
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
这样一段代码,提交的结果仍然是TL!请注意,这段代码什么处理都没做,只是初始化了些变量,和接受输入而已,却已经TL了,不得不放弃。
posted on 2006-11-25 17:22 wqlblogger 阅读(268) 评论(0) 编辑 收藏 举报