Submission #97319
Source Code Expand
#include <stdio.h> int flag[ 10000 ]; int n; int p[ 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 ) { 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 | 0 |
Code Size | 475 Byte |
Status | TLE |
Exec Time | 2029 ms |
Memory | 696 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:12:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] ./Main.c:15:8: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 2 | ||||
Status |
|
Set Name | Test Cases |
---|---|
All | 00, 01, 02, 90, 91 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00 | AC | 19 ms | 644 KB |
01 | TLE | 2029 ms | 688 KB |
02 | TLE | 2028 ms | 696 KB |
90 | AC | 18 ms | 660 KB |
91 | AC | 18 ms | 664 KB |