結果

問題 No.1015 おつりは要らないです
ユーザー polyesterpolyester
提出日時 2020-04-03 22:04:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 854 bytes
コンパイル時間 906 ms
コンパイル使用メモリ 81,292 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-16 01:47:35
合計ジャッジ時間 28,792 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1,669 ms
4,376 KB
testcase_11 AC 1,673 ms
4,376 KB
testcase_12 AC 1,669 ms
4,376 KB
testcase_13 AC 1,673 ms
4,376 KB
testcase_14 AC 1,672 ms
4,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 600 ms
4,380 KB
testcase_21 AC 601 ms
4,376 KB
testcase_22 AC 599 ms
4,380 KB
testcase_23 AC 600 ms
4,380 KB
testcase_24 AC 599 ms
4,380 KB
testcase_25 AC 598 ms
4,380 KB
testcase_26 AC 599 ms
4,380 KB
testcase_27 AC 601 ms
4,380 KB
testcase_28 AC 598 ms
4,380 KB
testcase_29 AC 603 ms
4,384 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 WA -
testcase_32 AC 15 ms
4,388 KB
testcase_33 TLE -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cstdio>
using namespace std;
using ll = long long;
int main(){
  int n, x, y, z;
  cin >> n >> x >> y >> z;
  bool ok = true;
  for(int i = 0; i < n; i++) {
    int a;
    cin >> a;
    while(a > 0){
      if(a >= 10000 && z > 0){
        a -= 10000;
        x--;
      }else if(a >= 5000 && y > 0){
        a -= 5000;
        y--;
      }else if(x > 0){
        a -= 1000;
        x--;
      }else if(y > 0){
        a -= 5000;
        y--;
      }else if(z > 0){
        a -= 10000;
        z--;
      }
      if(x == 0 && y == 0 && z == 0){
        ok = false;
        break;
      }
    }
  }
  if(!ok){
    cout << "No\n";
  }else{
    cout << "Yes\n";
  }
  return 0;
}
0