結果

問題 No.734 Careful Engineer
ユーザー hhgfhn1
提出日時 2018-09-28 21:42:59
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 2,444 ms
コンパイル使用メモリ 74,072 KB
実行使用メモリ 41,564 KB
最終ジャッジ日時 2024-10-12 06:37:37
合計ジャッジ時間 4,954 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 2 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();

		if (a * 60 <= b) {
			System.out.println(-1);
			return;
		}

		int t = a * 60;
		int p = b + c * 60 * 60;
		int ans = 1;
		while (t <= p) {
			t = a * 60 * ans;
			p = b * ans + c * 60 * 60;
			ans++;
		}

		System.out.println(ans-1);
	}
}
0