Submission #97417
Source Code Expand
#include <iostream> #include <vector> #include <set> int main() { int N; while(std::cin >> N) { std::vector<int> p(N); for(auto& a:p) std::cin >> a; std::set<int> dp; dp.insert(0); for(auto a: p) { std::set<int> dpn = dp; for(auto v: dp) dpn.insert(a+v); dp.swap(dpn); } std::cout << dp.size() << std::endl; } }
Submission Info
Submission Time | |
---|---|
Task | A - コンテスト |
User | jasy |
Language | C++11 (GCC 4.8.1) |
Score | 2 |
Code Size | 479 Byte |
Status | AC |
Exec Time | 66 ms |
Memory | 1160 KB |
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 | 21 ms | 692 KB |
01 | AC | 32 ms | 952 KB |
02 | AC | 66 ms | 1160 KB |
90 | AC | 19 ms | 772 KB |
91 | AC | 19 ms | 772 KB |