Submission #97302
Source Code Expand
#include <stdio.h> int main(void) { int dp[10101] = {0}; int ary[101]; int i, j, n; int res; scanf("%d", &n); for (i = 0; i < n; i++){ scanf("%d", ary + i); } dp[0] = 1; for (i = 0; i < n; i++){ for (j = 10000; j >= 0; j--){ if (dp[j]){ dp[j + ary[i]] = 1; } } } res = 0; for (i = 0; i <= 10000; i++){ res += dp[i]; } printf("%d\n", res); return (0); }
Submission Info
Submission Time | |
---|---|
Task | A - コンテスト |
User | orisano |
Language | C (GCC 4.6.4) |
Score | 2 |
Code Size | 418 Byte |
Status | AC |
Exec Time | 21 ms |
Memory | 776 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:10:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] ./Main.c:12:8: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 2 / 2 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | 00, 01, 02, 90, 91 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00 | AC | 17 ms | 772 KB |
01 | AC | 20 ms | 652 KB |
02 | AC | 21 ms | 776 KB |
90 | AC | 19 ms | 776 KB |
91 | AC | 18 ms | 652 KB |