結果
| 問題 |
No.804 野菜が苦手
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-26 14:57:37 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 122 ms / 2,000 ms |
| コード長 | 690 bytes |
| コンパイル時間 | 3,087 ms |
| コンパイル使用メモリ | 75,376 KB |
| 実行使用メモリ | 54,284 KB |
| 最終ジャッジ日時 | 2024-11-24 12:02:39 |
| 合計ジャッジ時間 | 5,898 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
import java.io.*;
import java.util.Scanner;
public class Main_yukicoder804 {
private static Scanner sc;
private static Printer pr;
private static void solve() {
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int d = sc.nextInt();
for (int i = a; i >= 0; i--) {
if (i * c <= b && i + i * c <= d) {
pr.println(i);
break;
}
}
}
// ---------------------------------------------------
public static void main(String[] args) {
sc = new Scanner(System.in);
pr = new Printer(System.out);
solve();
pr.close();
sc.close();
}
static class Printer extends PrintWriter {
Printer(OutputStream out) {
super(out);
}
}
}