Submission #97308
Source Code Expand
#include <stdio.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) int n, p[128], a[12800]; int main() { scanf("%d", &n); rep (i, n) scanf("%d", p+i); a[0] = 1; rep (i, n) for (int j = 12800-1; j >= 0; j--) if (a[j]) a[j+p[i]] = 1; int ans = 0; rep (i, 12800) ans += a[i]; printf("%d\n", ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - コンテスト |
User | kohyatoh |
Language | C++ (G++ 4.6.4) |
Score | 2 |
Code Size | 360 Byte |
Status | AC |
Exec Time | 21 ms |
Memory | 660 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:7:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] ./Main.cpp:8:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, 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 | 20 ms | 644 KB |
01 | AC | 20 ms | 636 KB |
02 | AC | 21 ms | 660 KB |
90 | AC | 18 ms | 652 KB |
91 | AC | 20 ms | 648 KB |