結果

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

ソースコード

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 ans = 1;
		int t = a*ans * 60;
		int p = b *ans+ c * 60 * 60;
		
		while (t < p) {
			t = a * 60 * ans;
			p = b * ans + c * 60 * 60;
			ans++;
		}

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