Submission #3027709
Source Code Expand
#include <algorithm> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> using namespace std; using ll = long long; #define fst first #define snd second /* clang-format off */ template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; }; template <class T> struct _vec<T, 0> { using type = T; }; template <class T, size_t D> using vec = typename _vec<T, D>::type; template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); } template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); } /* clang-format on */ int main() { int A, B, C, X; while (cin >> A >> B >> C >> X) { int res = 0; for (int a = 0; a <= A; a++) { for (int b = 0; b <= B; b++) { for (int c = 0; c <= C; c++) { if (500 * a + 100 * b + 50 * c == X) { ++res; } } } } cout << res << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Coins |
User | kroton |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1162 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 384 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample01.txt, sample02.txt, sample03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample01.txt, sample02.txt, sample03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 1 ms | 256 KB |
06.txt | AC | 1 ms | 256 KB |
07.txt | AC | 1 ms | 256 KB |
08.txt | AC | 1 ms | 256 KB |
09.txt | AC | 1 ms | 256 KB |
10.txt | AC | 1 ms | 256 KB |
sample01.txt | AC | 1 ms | 256 KB |
sample02.txt | AC | 1 ms | 256 KB |
sample03.txt | AC | 2 ms | 384 KB |