- 过河
- 2014-12-21 14:52:55 @
#include<stdio.h>
long long L;
short S,T,M;
int x=0,l=0,i;
int stone(int s[])
{
int temp=1,j;
for(j=0;s[j]<=l;j++);
while(i<=s[j+1]){if(l-i>S&&l-i<T)temp=0;i++;}
return temp;
}
void go(int s[])
{
if(stone(s)==1)x++;
l+=i;
if(l>=L) return;
else go(s);
}
int main(void)
{
int i;
scanf("%d",&L);
scanf("%d %d %d",&S,&T,&M);
int s[M];
for(i=0;i<=M-1;i++)scanf("%d",&s[i]);
go(s);
printf("%d",x);
return 0;
}大神问题出在哪里
3 条评论
-
hanghang0702 LV 8 @ 2016-10-02 14:07:52
*** [ Runtime Error. Gets = 0. ]***
* Runtime Error[TOTAL SET = 10] *
* Judging... Wrong Answer
No.1: Runtime Error 201(3 more lines)
No.2: Runtime Error 201(3 more lines)
No.3: Runtime Error 201(3 more lines)
To many error got. Stop judger.* -
2016-07-13 16:00:08@
6666666666666666666666666666666
-
2014-12-21 15:27:46@
好吧不是回溯。。我也不太清楚是什么算法
- 1