怎么错了?请大家帮帮忙

记录信息
评测状态 Wrong Answer
题目 P1902 学姐的清晨问候
递交时间 2015-08-16 20:59:22
代码语言 C++
评测机 VijosEx
消耗时间 117 ms
消耗内存 524 KiB
评测时间 2015-08-16 20:59:23
评测结果
编译成功

测试数据 #0: WrongAnswer, time = 0 ms, mem = 520 KiB, score = 0
测试数据 #1: WrongAnswer, time = 0 ms, mem = 520 KiB, score = 0
测试数据 #2: Accepted, time = 0 ms, mem = 516 KiB, score = 10
测试数据 #3: Accepted, time = 1 ms, mem = 520 KiB, score = 10
测试数据 #4: Accepted, time = 15 ms, mem = 520 KiB, score = 10
测试数据 #5: Accepted, time = 15 ms, mem = 520 KiB, score = 10
测试数据 #6: Accepted, time = 41 ms, mem = 516 KiB, score = 10
测试数据 #7: Accepted, time = 15 ms, mem = 520 KiB, score = 10
测试数据 #8: Accepted, time = 15 ms, mem = 524 KiB, score = 10
测试数据 #9: Accepted, time = 15 ms, mem = 520 KiB, score = 10
WrongAnswer, time = 117 ms, mem = 524 KiB, score = 80
代码
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
char s[1010];
char cmp[20]={"good morning"};
int time[20];
int main()
{
int n;
scanf("%d\n",&n);
for(int t=1;t<=n;t++)
{
memset(time,0,sizeof(time));
memset(s,0,sizeof(s));
gets(s);
if(t!=1)
printf("\n");
for(int i=strlen(s)-1;i>=0;i--)
{
for(int j=0;j<=11;j++)
{
if(cmp[j]==s[i])
{
if(s[i]=='o')
{
time[j]+=2;
break;
}
else if(s[i]=='g'||s[i]=='n')
{
time[j]+=3;
break;
}
else
{
time[j]+=6;
break;
}
}
}
}
int min=1000001;
for(int i=9;i>=0;i--)
{
if(i==2||i==6)continue;
if(time[i]<min)
min=time[i];
}
printf("Case #%d: %d",t,min/6);
}
}

1 条评论

  • @ 2015-08-16 21:13:16

    评测结果
    编译成功

    测试数据 #0: Accepted, time = 15 ms, mem = 520 KiB, score = 10
    测试数据 #1: Accepted, time = 0 ms, mem = 520 KiB, score = 10
    测试数据 #2: Accepted, time = 0 ms, mem = 520 KiB, score = 10
    测试数据 #3: Accepted, time = 0 ms, mem = 520 KiB, score = 10
    测试数据 #4: Accepted, time = 3 ms, mem = 516 KiB, score = 10
    测试数据 #5: Accepted, time = 4 ms, mem = 520 KiB, score = 10
    测试数据 #6: Accepted, time = 0 ms, mem = 520 KiB, score = 10
    测试数据 #7: Accepted, time = 0 ms, mem = 520 KiB, score = 10
    测试数据 #8: Accepted, time = 2 ms, mem = 516 KiB, score = 10
    测试数据 #9: Accepted, time = 4 ms, mem = 528 KiB, score = 10
    Accepted, time = 28 ms, mem = 528 KiB, score = 100

    ###又对了,莫名其妙

    #include <iostream>
    #include <stdio.h>
    #include <string.h>
    using namespace std;
    char s;
    char cmp[120]={"good morning"};
    int time[120];
    int main()
    {
    int n;
    scanf("%d",&n);
    while((s=getchar())==' ');
    for(int t=1;t<=n;t++)
    {
    memset(time,0,sizeof(time));
    if(t!=1)
    printf("\n");
    for(;;)
    { s=getchar();
    if(s=='\n')break;
    for(int j=0;j<=11;j++)
    {
    if(cmp[j]==s)
    {
    if(s=='o')
    {
    time[j]+=2;
    break;
    }
    else if(s=='g'||s=='n')
    {
    time[j]+=3;
    break;
    }
    else
    {
    time[j]+=6;
    break;
    }
    }
    }
    }
    int min=1000000001;
    for(int i=9;i>=0;i--)
    {
    if(i==2||i==6)continue;
    if(time[i]<min)
    min=time[i];
    }
    printf("Case #%d: %d",t,min/6);
    }
    }

  • 1

信息

ID
1902
难度
7
分类
(无)
标签
(无)
递交数
1572
已通过
340
通过率
22%
被复制
6
上传者