Submission #1367173
Source Code Expand
#include<stdio.h> #define MAX 10000 int N; int p[101]; int dp[MAX+1]; int main() { int i,j,ans=0; scanf("%d",&N); for(i=0;i<N;i++) scanf("%d",&p[i]); for(i=0;i<MAX+1;i++) dp[i] = 0; dp[0] = 1; for(i=0;i<N;i++) for(j=10000;j>=0;j--) if(dp[j] == 1) dp[j+p[i]] = 1; for(i=0;i<MAX+1;i++) ans += dp[i]; printf("%d\n",ans); }
Submission Info
Submission Time | |
---|---|
Task | A - コンテスト |
User | makss |
Language | C (GCC 5.4.1) |
Score | 2 |
Code Size | 392 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:10:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&N); ^ ./Main.c:12:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&p[i]); ^
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 | 1 ms | 256 KB |
01 | AC | 1 ms | 256 KB |
02 | AC | 1 ms | 256 KB |
90 | AC | 1 ms | 256 KB |
91 | AC | 1 ms | 256 KB |