第一次:
状态: Unaccepted
测评机: Xeost[5]
得分: 80分
提交日期: 2012-7-14 15:30:00
有效耗时: 422毫秒
测试结果1: 选手程序运行超过时限
测试结果2: 测试结果错误.错误结果为:11
正确结果应为:3
测试结果3: 通过本测试点|有效耗时47ms
测试结果4: 通过本测试点|有效耗时46ms
测试结果5: 通过本测试点|有效耗时47ms
测试结果6: 通过本测试点|有效耗时47ms
测试结果7: 通过本测试点|有效耗时63ms
测试结果8: 通过本测试点|有效耗时47ms
测试结果9: 通过本测试点|有效耗时62ms
测试结果10: 通过本测试点|有效耗时63ms
#include <stdio.h>
02.#include <string>
03.#include <conio.h>
04.using namespace std;
05.int main()
06.{
07.
//FILE *ff=fopen("290.in","r");
08.
int n,f=0,f2,l;
09.
scanf("%d",&n);
10.
char c[351];
11.
scanf("%s",c);
12.
string s=c;
13.
for(int i=0;i<n;i++){
14.
string ss=s.substr(i+1,n-i-1)+s.substr(0,i+1);
15.
char cc=ss[0]; ss.erase(0,1); f2=1,l=n-1;
16.
while(l&&cc=='w'){cc=ss[0]; ss.erase(0,1); l--; f2++;}
17.
while(l&&(ss[0]==cc||ss[0]=='w')){ss.erase(0,1); f2++; l--;}
18.
if(l){
19.
cc=ss[l-1]; ss.erase(l-1,1); f2++; l--;
20.
while(l&&cc=='w'){cc=ss[l-1]; ss.erase(l-1,1); l--; f2++;}
21.
while(l&&(ss[l-1]==cc||ss[l-1]=='w')){ss.erase(l-1,1); f2++; l--;}
22.
}
23.
f=(f>f2)?f:f2;
24.
}
25.
printf("%d",f);
26.// getch();
27.
return 0;
28.}
第二次:只是把注释删掉了
状态: Accepted
测评机: Xeost[5]
得分: 100分 [我要评价一下题目~]
提交日期: 2012-7-14 15:35:00
有效耗时: 578毫秒
测试结果1: 通过本测试点|有效耗时109ms
测试结果2: 通过本测试点|有效耗时63ms
测试结果3: 通过本测试点|有效耗时62ms
测试结果4: 通过本测试点|有效耗时47ms
测试结果5: 通过本测试点|有效耗时47ms
测试结果6: 通过本测试点|有效耗时47ms
测试结果7: 通过本测试点|有效耗时47ms
测试结果8: 通过本测试点|有效耗时47ms
测试结果9: 通过本测试点|有效耗时62ms
测试结果10: 通过本测试点|有效耗时47ms
#include <stdio.h>
02.#include <string>
03.#include <conio.h>
04.using namespace std;
05.int main()
06.{
07.
int n,f=0,f2,l;
08.
scanf("%d",&n);
09.
char c[351];
10.
scanf("%s",c);
11.
string s=c;
12.
for(int i=0;i<n;i++){
13.
string ss=s.substr(i+1,n-i-1)+s.substr(0,i+1);
14.
char cc=ss[0]; ss.erase(0,1); f2=1,l=n-1;
15.
while(l&&cc=='w'){cc=ss[0]; ss.erase(0,1); l--; f2++;}
16.
while(l&&(ss[0]==cc||ss[0]=='w')){ss.erase(0,1); f2++; l--;}
17.
if(l){
18.
cc=ss[l-1]; ss.erase(l-1,1); f2++; l--;
19.
while(l&&cc=='w'){cc=ss[l-1]; ss.erase(l-1,1); l--; f2++;}
20.
while(l&&(ss[l-1]==cc||ss[l-1]=='w')){ss.erase(l-1,1); f2++; l--;}
21.
}
22.
f=(f>f2)?f:f2;
23.
}
24.
printf("%d",f);
25.
return 0;
26.}
这是个什么情况?? 注释还会影响。。