Submission #2869311


Source Code Expand

#include <cstdio>
using namespace std;
int a[10100],f[10100][110];
int main()
{
    int n,k,i,j;
    scanf("%d%d",&n,&k);
    for(i=1;i<=n;i++)
        scanf("%d",&a[i]);
    f[0][0]=1;
    for(i=1;i<=n;i++)
        for(j=0;j<k;j++)
            f[i][j]=f[i-1][(j+a[i])%k]||f[i-1][(j-a[i]%k+k)%k];
    if(f[n][0]==0)printf("NO");
    else printf("YES");
    return 0;
}

Submission Info

Submission Time
Task H - N and K
User luogu_bot3
Language C++ (GCC 5.4.1)
Score 0
Code Size 386 Byte
Status RE
Exec Time 98 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&k);
                        ^
./Main.cpp:9:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&a[i]);
                          ^

Judge Result

Set Name subtask All
Score / Max Score 0 / 50 0 / 700
Status
WA × 33
WA × 33
RE × 12
Set Name Test Cases
subtask 00_small_00.txt, 01_small_01.txt, 02_small_02.txt, 04_small_03.txt, 04_small_04.txt, 04_small_05.txt, 04_small_06.txt, 04_small_07.txt, 04_small_08.txt, 04_small_09.txt, 04_small_10.txt, 04_small_11.txt, 04_small_12.txt, 04_small_13.txt, 04_small_14.txt, 04_small_15.txt, 04_small_16.txt, 04_small_17.txt, 04_small_18.txt, 04_small_19.txt, 04_small_20.txt, 04_small_21.txt, 04_small_22.txt, 04_small_23.txt, 04_small_24.txt, 04_small_25.txt, 04_small_26.txt, 04_small_27.txt, 04_small_28.txt, 04_small_29.txt, 04_small_30.txt, 04_small_31.txt, 04_small_32.txt
All 00_small_00.txt, 01_small_01.txt, 02_small_02.txt, 04_small_03.txt, 04_small_04.txt, 04_small_05.txt, 04_small_06.txt, 04_small_07.txt, 04_small_08.txt, 04_small_09.txt, 04_small_10.txt, 04_small_11.txt, 04_small_12.txt, 04_small_13.txt, 04_small_14.txt, 04_small_15.txt, 04_small_16.txt, 04_small_17.txt, 04_small_18.txt, 04_small_19.txt, 04_small_20.txt, 04_small_21.txt, 04_small_22.txt, 04_small_23.txt, 04_small_24.txt, 04_small_25.txt, 04_small_26.txt, 04_small_27.txt, 04_small_28.txt, 04_small_29.txt, 04_small_30.txt, 04_small_31.txt, 04_small_32.txt, 05_medium_33.txt, 06_medium_34.txt, 07_large_35.txt, 07_large_36.txt, 07_large_37.txt, 07_large_38.txt, 07_large_39.txt, 08_large_40.txt, 08_large_41.txt, 08_large_42.txt, 08_large_43.txt, 08_large_44.txt
Case Name Status Exec Time Memory
00_small_00.txt WA 1 ms 128 KB
01_small_01.txt WA 1 ms 128 KB
02_small_02.txt WA 1 ms 128 KB
04_small_03.txt WA 1 ms 128 KB
04_small_04.txt WA 1 ms 128 KB
04_small_05.txt WA 1 ms 128 KB
04_small_06.txt WA 1 ms 128 KB
04_small_07.txt WA 1 ms 128 KB
04_small_08.txt WA 1 ms 128 KB
04_small_09.txt WA 1 ms 128 KB
04_small_10.txt WA 1 ms 128 KB
04_small_11.txt WA 1 ms 128 KB
04_small_12.txt WA 2 ms 256 KB
04_small_13.txt WA 1 ms 128 KB
04_small_14.txt WA 1 ms 128 KB
04_small_15.txt WA 1 ms 128 KB
04_small_16.txt WA 1 ms 128 KB
04_small_17.txt WA 1 ms 128 KB
04_small_18.txt WA 1 ms 128 KB
04_small_19.txt WA 1 ms 128 KB
04_small_20.txt WA 1 ms 128 KB
04_small_21.txt WA 1 ms 128 KB
04_small_22.txt WA 1 ms 128 KB
04_small_23.txt WA 1 ms 128 KB
04_small_24.txt WA 1 ms 128 KB
04_small_25.txt WA 1 ms 128 KB
04_small_26.txt WA 1 ms 128 KB
04_small_27.txt WA 1 ms 128 KB
04_small_28.txt WA 1 ms 128 KB
04_small_29.txt WA 1 ms 128 KB
04_small_30.txt WA 1 ms 128 KB
04_small_31.txt WA 1 ms 128 KB
04_small_32.txt WA 1 ms 128 KB
05_medium_33.txt RE 98 ms 256 KB
06_medium_34.txt RE 98 ms 256 KB
07_large_35.txt RE 98 ms 256 KB
07_large_36.txt RE 98 ms 128 KB
07_large_37.txt RE 98 ms 256 KB
07_large_38.txt RE 98 ms 256 KB
07_large_39.txt RE 98 ms 256 KB
08_large_40.txt RE 98 ms 256 KB
08_large_41.txt RE 98 ms 256 KB
08_large_42.txt RE 98 ms 256 KB
08_large_43.txt RE 98 ms 256 KB
08_large_44.txt RE 98 ms 256 KB