Submission #44914


ソースコード

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
#include<bits/stdc++.h>
using namespace std;
long long a,b,t;
bool slv(long long mid){
long long Parsee=sqrt(mid);
long long YDK = b*mid - b*Parsee + a*Parsee;
if(t <= YDK)return true;
return false;
}
int main(){
cin>>a>>b>>t;
long long left=1ll,right=(t/min({a,b,t}))+1ll,mid,ans=right;
while(left<=right){
mid=(left+right)/2ll;
if(slv(mid)){
right=mid-1ll;
ans=mid;
}
else{
left=mid+1ll;
}
}
cout<<ans<<endl;
return(0);
}

ステータス

項目 データ
問題 0993 - 貯金 (Saving Money)
ユーザー名 Doll
投稿日時 2018-11-14 21:37:35
言語 C++11
状態 Accepted
得点 10
ソースコード長 488 Byte
最大実行時間 36 ms
最大メモリ使用量 788 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input-sample01 AC 24 ms 604 KB
1
input-sample02 AC 20 ms 576 KB
1
input-sample03 AC 24 ms 552 KB
1
input01 AC 24 ms 388 KB
1
input02 AC 23 ms 488 KB
1
input03 AC 36 ms 588 KB
1
input04 AC 20 ms 552 KB
1
input05 AC 17 ms 524 KB
1
input06 AC 16 ms 496 KB
1
input07 AC 31 ms 724 KB
1
input08 AC 28 ms 572 KB
1
input09 AC 30 ms 672 KB
1
input10 AC 31 ms 644 KB
1
input11 AC 32 ms 616 KB
1
input12 AC 24 ms 588 KB
1
input13 AC 33 ms 556 KB
1
input14 AC 21 ms 524 KB
1
input15 AC 22 ms 496 KB
1
input16 AC 22 ms 468 KB
1
input17 AC 23 ms 568 KB
1
input18 AC 18 ms 540 KB
1
input19 AC 23 ms 644 KB
1
input20 AC 20 ms 616 KB
1
input21 AC 21 ms 584 KB
1
input22 AC 21 ms 684 KB
1
input23 AC 20 ms 788 KB
1
input24 AC 21 ms 628 KB
1
input25 AC 20 ms 728 KB
1
input26 AC 23 ms 700 KB
1
input27 AC 20 ms 544 KB
1
input28 AC 16 ms 520 KB
1
input29 AC 22 ms 620 KB
1
input30 AC 32 ms 588 KB
1