結果

問題 No.804 野菜が苦手
ユーザー geshi_crep23geshi_crep23
提出日時 2019-03-22 22:47:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 1,600 ms
コンパイル使用メモリ 166,620 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 09:58:23
合計ジャッジ時間 3,288 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 WA -
testcase_19 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A,B,C,D;
  cin >> A>>B>>C>>D;
if(A+A*C>=D){
  if(A*C<=B){
  cout<<A<<endl;
  }
  else if(A*C>B){
  cout<<B/C<<endl;
  }
}
else if(A+A*C<D){
  if(A*C<=B){
    for (int a = 0; A+A*C < D; a++) {
    A--;
    }
  cout<<A<<endl;
  }
  else if(A*C>B){
    if(B/C+B/C*C>D){
    for (int b = 0; B/C+B/C*C < D; b++) {
    B--;
    }
  cout<<B/C<<endl;
  }
  }
    if(B/C+B/C*C<=D){
  cout<<B/C<<endl;
  }
}
}
0