結果

問題 No.734 Careful Engineer
ユーザー hhgfhn1hhgfhn1
提出日時 2018-09-29 00:39:35
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 540 bytes
コンパイル時間 6,428 ms
コンパイル使用メモリ 83,716 KB
実行使用メモリ 53,916 KB
最終ジャッジ日時 2024-04-20 12:27:20
合計ジャッジ時間 5,454 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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;
		}

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

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