結果

問題 No.3046 yukicoderの過去問
ユーザー るさるさ
提出日時 2019-04-01 22:07:03
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 390 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 28,724 KB
実行使用メモリ 6,960 KB
最終ジャッジ日時 2023-08-18 01:14:24
合計ジャッジ時間 3,708 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,960 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
int main(void){
    // Your code here!
    int k,n;
    scanf("%d",&k);
    scanf("%d",&n);
    int x[100000];
    for(int i=0;i<n;i++){
        scanf("%d",&x[i]);
    }
    int c[200000];
    c[0]=1;
    for(int i=0;i<k;i++){
        for(int j=0;j<n;j++){
            int xx=x[j];
            c[i+xx]=(c[i+xx]+c[i])%1000000007;
        }
    }
    printf("%d",c[k]);
}

0