結果
問題 | No.1015 おつりは要らないです |
ユーザー | yuma220284 |
提出日時 | 2024-09-20 22:11:29 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,744 bytes |
コンパイル時間 | 2,262 ms |
コンパイル使用メモリ | 206,616 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-20 22:12:07 |
合計ジャッジ時間 | 4,327 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 36 ms
5,376 KB |
testcase_16 | AC | 36 ms
5,376 KB |
testcase_17 | AC | 38 ms
5,376 KB |
testcase_18 | AC | 37 ms
5,376 KB |
testcase_19 | AC | 37 ms
5,376 KB |
testcase_20 | AC | 39 ms
5,376 KB |
testcase_21 | AC | 38 ms
5,376 KB |
testcase_22 | AC | 39 ms
5,376 KB |
testcase_23 | AC | 37 ms
5,376 KB |
testcase_24 | AC | 37 ms
5,376 KB |
testcase_25 | AC | 36 ms
5,376 KB |
testcase_26 | AC | 35 ms
5,376 KB |
testcase_27 | AC | 36 ms
5,376 KB |
testcase_28 | AC | 36 ms
5,376 KB |
testcase_29 | AC | 36 ms
5,376 KB |
testcase_30 | AC | 2 ms
5,376 KB |
testcase_31 | AC | 18 ms
5,376 KB |
testcase_32 | AC | 17 ms
5,376 KB |
testcase_33 | AC | 42 ms
5,376 KB |
testcase_34 | AC | 2 ms
5,376 KB |
testcase_35 | AC | 1 ms
5,376 KB |
testcase_36 | WA | - |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rrep(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--) #define ALL(v) (v).begin(), (v).end() #define UNIQUE(v) sort(ALL(v)), (v).erase(unique(ALL(v)), (v).end()) #define SZ(v) (int)v.size() #define MIN(v) *min_element(ALL(v)) #define MAX(v) *max_element(ALL(v)) #define LB(v, x) int(lower_bound(ALL(v), (x)) - (v).begin()) #define UB(v, x) int(upper_bound(ALL(v), (x)) - (v).begin()) using uint = unsigned int; using ll = long long int; using ull = unsigned long long; using i128 = __int128_t; using u128 = __uint128_t; const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; template <typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } template <typename T, typename U> T ceil(T x, U y) { assert(y != 0); if (y < 0) x = -x, y = -y; return (x > 0 ? (x + y - 1) / y : x / y); } template <typename T, typename U> T floor(T x, U y) { assert(y != 0); if (y < 0) x = -x, y = -y; return (x > 0 ? x / y : (x - y + 1) / y); } template <typename T> int popcnt(T x) { return __builtin_popcountll(x); } template <typename T> int topbit(T x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); } template <typename T> int lowbit(T x) { return (x == 0 ? -1 : __builtin_ctzll(x)); } template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p) { os << "P(" << p.first << ", " << p.second << ")"; return os; } template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os << "{"; for (int i = 0; i < vec.size(); i++) { os << vec[i] << (i + 1 == vec.size() ? "" : ", "); } os << "}"; return os; } template <typename T, typename U> ostream &operator<<(ostream &os, const map<T, U> &map_var) { os << "{"; for (auto itr = map_var.begin(); itr != map_var.end(); itr++) { os << "(" << itr->first << ", " << itr->second << ")"; itr++; if (itr != map_var.end()) os << ", "; itr--; } os << "}"; return os; } template <typename T> ostream &operator<<(ostream &os, const set<T> &set_var) { os << "{"; for (auto itr = set_var.begin(); itr != set_var.end(); itr++) { os << *itr; ++itr; if (itr != set_var.end()) os << ", "; itr--; } os << "}"; return os; } #ifdef LOCAL #define show(...) _show(0, #__VA_ARGS__, __VA_ARGS__) #else #define show(...) true #endif template <typename T> void _show(int i, T name) { cerr << '\n'; } template <typename T1, typename T2, typename... T3> void _show(int i, const T1 &a, const T2 &b, const T3 &...c) { for (; a[i] != ',' && a[i] != '\0'; i++) cerr << a[i]; cerr << ":" << b << " "; _show(i + 1, a, c...); } /** * @brief template */ int main() { int N; ll X, Y, Z; cin >> N >> X >> Y >> Z; vector<ll> A(N); rep(i,0,N) { cin >> A[i]; A[i] = A[i]/1000 + 1; Z -= A[i]/10; A[i] %= 10; } if (Z < 0) { cout << "No" << endl; return 0; } sort(ALL(A)); while(Z > 0 && !A.empty()) { Z--; A.pop_back(); } N = A.size(); rep(i,0,N) { Y -= A[i]/5; A[i] %= 5; } if (Y < 0) { cout << "No" << endl; return 0; } sort(ALL(A)); while(Y > 0 && !A.empty()) { Y--; A.pop_back(); } N = A.size(); rep(i,0,N) X -= A[i]; cout << (X==0?"Yes":"No") << endl; }