Submission #97408
Source Code Expand
#include <stdio.h> int flag[ 10000 ], p[ 100 ], n, dp[ 10000 ][ 100 ]; void dfs( int, int ); int main( void ) { int i, sum; scanf( "%d", &n ); for ( i = 0; i < n; i++ ) scanf( "%d", p + i ); dfs( 0, 0 ); sum = 0; for ( i = 0; i < 10000; i++ ) sum += flag[ i ]; printf( "%d\n", sum ); return 0; } void dfs( int score, int i ) { if ( dp[ score ][ i ] ) return; dp[ score ][ i ] = 1; flag[ score ] = 1; if ( i == n ) return; dfs( score, i + 1 ); dfs( score + p[ i ], i + 1 ); }
Submission Info
Submission Time | |
---|---|
Task | A - コンテスト |
User | zeosutt |
Language | C (GCC 4.6.4) |
Score | 2 |
Code Size | 560 Byte |
Status | AC |
Exec Time | 31 ms |
Memory | 2744 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:13: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 | 19 ms | 856 KB |
01 | AC | 25 ms | 1800 KB |
02 | AC | 31 ms | 2744 KB |
90 | AC | 20 ms | 644 KB |
91 | AC | 19 ms | 648 KB |