记录详情

Accepted

foo.c: In function 'main':
foo.c:7:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&n,&k);
     ^~~~~~~~~~~~~~~~~~~~
# 状态 耗时 内存占用
#1 Accepted 1ms 256.0 KiB
#2 Accepted 1ms 288.0 KiB
#3 Accepted 1ms 256.0 KiB
#4 Accepted 1ms 288.0 KiB
#5 Accepted 1ms 256.0 KiB

代码

#include <stdio.h>
#define N 1000000007
int main ()
{
    int n,k,i;
    long long p=1;
    scanf("%d %d",&n,&k);
    for(i=1;i<=n;i++)
    {
        p*=(k+1);
       // printf("i=%d,p1=%lld ",i,p);
        p%=N;
        //printf("p2=%lld\n ",p);

    }
    printf("%lld",p);

    return 0;

}

信息

递交者
类型
递交
题目
P1005 hitwh 2019 新生赛 F Ramen and his faculty
语言
C
递交时间
2020-12-22 20:59:54
评测时间
2020-12-22 20:59:54
评测机
分数
100
总耗时
6ms
峰值内存
288.0 KiB