Submission #44917


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.*;
class Main {
static long A, B, T;
static boolean isOK(long x)
{
long p = (long)Math.sqrt(x);
return A*p + B*(x-p) >= T;
}
public static void main(String[]$) {
Scanner sc = new Scanner(System.in);
A = sc.nextInt();
B = sc.nextInt();
T = sc.nextLong();
long low=0, hi=T+1, mid;
while(hi-low > 1) {
mid = (low + hi) / 2;
if (isOK(mid)) hi = mid;
else low = mid;
}
System.out.println(hi);
}
}

ステータス

項目 データ
問題 0993 - 貯金 (Saving Money)
ユーザー名 Arumakan_ei1727
投稿日時 2018-11-14 22:35:34
言語 Java
状態 Accepted
得点 10
ソースコード長 472 Byte
最大実行時間 202 ms
最大メモリ使用量 18112 KB

セット

セット 得点 Cases
1 ALL 10 / 10 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input-sample01 AC 202 ms 15964 KB
1
input-sample02 AC 134 ms 16032 KB
1
input-sample03 AC 129 ms 16144 KB
1
input01 AC 129 ms 16016 KB
1
input02 AC 124 ms 15832 KB
1
input03 AC 131 ms 16260 KB
1
input04 AC 137 ms 16284 KB
1
input05 AC 126 ms 16096 KB
1
input06 AC 123 ms 16176 KB
1
input07 AC 130 ms 16220 KB
1
input08 AC 122 ms 15948 KB
1
input09 AC 121 ms 16204 KB
1
input10 AC 137 ms 16172 KB
1
input11 AC 131 ms 16152 KB
1
input12 AC 119 ms 16052 KB
1
input13 AC 125 ms 16200 KB
1
input14 AC 126 ms 15844 KB
1
input15 AC 123 ms 16336 KB
1
input16 AC 122 ms 17988 KB
1
input17 AC 120 ms 16408 KB
1
input18 AC 119 ms 16128 KB
1
input19 AC 119 ms 15944 KB
1
input20 AC 128 ms 18112 KB
1
input21 AC 122 ms 16180 KB
1
input22 AC 119 ms 16288 KB
1
input23 AC 129 ms 16192 KB
1
input24 AC 137 ms 16320 KB
1
input25 AC 126 ms 16240 KB
1
input26 AC 120 ms 16160 KB
1
input27 AC 125 ms 16228 KB
1
input28 AC 129 ms 16192 KB
1
input29 AC 123 ms 16364 KB
1
input30 AC 124 ms 18028 KB
1