Submission #11376718
Source Code Expand
#include "bits/stdc++.h" using namespace std; #define fst first #define scd second int main() { int n; bitset<10001> dp(1); scanf("%d", &n); for(int i = 0, p; i < n; ++i) { scanf("%d", &p); dp |= (dp << p); } printf("%d\n", (int)dp.count()); }
Submission Info
Submission Time | |
---|---|
Task | A - コンテスト |
User | duckman |
Language | C++14 (GCC 5.4.1) |
Score | 2 |
Code Size | 270 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:9:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ ./Main.cpp:12:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &p); ^
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 |