Submission #50856


ソースコード

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include<bits/stdc++.h>
using namespace std;
#define fin << '\n'
#define pb push_back
#define all(x) x.begin(), x.end()
#define rep( i, m, n ) for ( int i = m; i < n; ++i )
typedef long long ll;
typedef vector<int> vi;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
ll a, b, t;
bool isOK( ll n ) {
ll tmpA = sqrt( n );
ll tmpB = n - tmpA;
if( (a * tmpA) + (b * tmpB) >= t ) return true;
else return false;
}
signed main()
{
cin.tie(0); ios::sync_with_stdio(false);
cin >> a >> b >> t;
ll low = 0;
ll high = 100000000000001LL;
while ( high - low > 1 ) {
ll mid = low + (high - low) / 2;
if( isOK( mid ) ) high = mid;
else low = mid;
}
cout << high fin;
return 0;
}

ステータス

項目 データ
問題 0993 - 貯金 (Saving Money)
ユーザー名 もけ
投稿日時 2019-06-21 22:52:54
言語 C++
状態 Accepted
得点 10
ソースコード長 776 Byte
最大実行時間 35 ms
最大メモリ使用量 772 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input-sample01 AC 35 ms 604 KB
1
input-sample02 AC 23 ms 432 KB
1
input-sample03 AC 20 ms 384 KB
1
input01 AC 23 ms 464 KB
1
input02 AC 15 ms 548 KB
1
input03 AC 20 ms 628 KB
1
input04 AC 24 ms 456 KB
1
input05 AC 30 ms 408 KB
1
input06 AC 21 ms 364 KB
1
input07 AC 23 ms 576 KB
1
input08 AC 18 ms 660 KB
1
input09 AC 18 ms 616 KB
1
input10 AC 25 ms 448 KB
1
input11 AC 21 ms 400 KB
1
input12 AC 26 ms 484 KB
1
input13 AC 20 ms 572 KB
1
input14 AC 21 ms 528 KB
1
input15 AC 20 ms 612 KB
1
input16 AC 19 ms 696 KB
1
input17 AC 20 ms 652 KB
1
input18 AC 24 ms 608 KB
1
input19 AC 18 ms 692 KB
1
input20 AC 20 ms 772 KB
1
input21 AC 21 ms 604 KB
1
input22 AC 23 ms 552 KB
1
input23 AC 27 ms 632 KB
1
input24 AC 29 ms 584 KB
1
input25 AC 19 ms 540 KB
1
input26 AC 24 ms 624 KB
1
input27 AC 20 ms 712 KB
1
input28 AC 22 ms 544 KB
1
input29 AC 23 ms 624 KB
1
input30 AC 20 ms 580 KB
1