记录详情

Wrong Answer


  
# 状态 耗时 内存占用
#1 Accepted 1ms 208.0 KiB
#2 Accepted 1ms 128.0 KiB
#3 Accepted 1ms 216.0 KiB
#4 Wrong Answer 1ms 128.0 KiB
#5 Accepted 1ms 220.0 KiB
#6 Accepted 0ms 128.0 KiB
#7 Accepted 0ms 220.0 KiB
#8 Wrong Answer 1ms 128.0 KiB
#9 Wrong Answer 0ms 204.0 KiB

代码

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,m,*t=NULL;
    int time=0;
    int count=0,civil=0;
    scanf("%d %d",&n,&m);
    t=(int*)malloc(sizeof(int)*n);
    if(t==NULL)
    {
        printf("error\n");
        exit(0);
    }
    for(int i=0;i<n;i++)
    {
        scanf("%d",&t[i]);
    }
    while(civil!=m&&count!=n)
    {
        time++;
        civil=civil+n-count;
        if(time==t[count])
        {
            count++;
            time=0;
        }
    }
    if(civil==m)
        printf("Yes");
    else
        printf("No");
}

信息

递交者
类型
递交
题目
P1007 hitwh 2019 新生赛 H Songer and his army
语言
C
递交时间
2020-12-19 16:21:34
评测时间
2020-12-19 16:21:34
评测机
分数
60
总耗时
9ms
峰值内存
220.0 KiB