Submission #1385394
Source Code Expand
#include <stdio.h> int max(int a,int b){ if(a>b)return a; return b; } int main(void){ int N; scanf("%d",&N); int a; int P[10000]={}; P[0]=1; for(int i=0;i<N;i++){ scanf("%d",&a); for(int i=9999;i>=0;i--)if(P[i]==1)P[i+a]=1; } int ans=0; for(int i=0;i<10000;i++)if(P[i]==1)ans++; printf("%d\n",ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - コンテスト |
User | xxkiritoxx |
Language | C (GCC 5.4.1) |
Score | 2 |
Code Size | 403 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:10:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&N); ^ ./Main.c:15:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&a); ^
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 |