Submission #7069324
Source Code Expand
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
constexpr char EL[] = "\n";
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
template<typename T = i64>
T IN() { T x; cin >> x; return (x); }
template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }
template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
if (comp(xmax, x)) {
xmax = x;
return true;
}
return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
if (comp(x, xmin)) {
xmin = x;
return true;
}
return false;
}
void print() {
cout << EL;
}
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
cout << head;
if (sizeof...(tail) != 0) cout << " ";
print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
for (auto& a : vec) {
cout << a;
if (&a != &vec.back()) cout << " ";
}
cout << EL;
}
template <class T>
void print(vector<vector<T>> &df) {
for (auto& vec : df) {
print(vec);
}
}
struct ProconInit {
static constexpr int IOS_PREC = 15;
static constexpr bool AUTOFLUSH = false;
ProconInit() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(IOS_PREC);
if (AUTOFLUSH)
cout << unitbuf;
}
} PROCON_INIT;
#pragma endregion
signed solve()
{
int a, b, c, x;
cin >> a >> b >> c >> x;
if (a > 0) a++;
if (a > 0) b++;
if (a > 0) c++;
int ans = 0;
REP(i, a)
{
if (x < 500 * i)
break;
REP(j, b)
{
if (x < 500 * i + 100 * j)
break;
REP(k, c)
{
if (x == 500 * i + 100 * j + 50 * k)
ans++;
else if (x < 500 * i + 100 * j + 50 * k)
break;
}
}
}
print(ans);
return 0;
}
#ifndef LOCALCODE
signed main()
{
return solve();
}
#endif
Submission Info
Submission Time |
|
Task |
B - Coins |
User |
Nagi7692 |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
2875 Byte |
Status |
WA |
Exec Time |
1 ms |
Memory |
256 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 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 |
WA |
1 ms |
256 KB |
09.txt |
WA |
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 |
1 ms |
256 KB |