Submission #44946


ソースコード

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<iostream>
using namespace std;
int main(){
int A, B;
long long T;
long long SM = 0ll;
long long i = 1ll;
long long j = 0ll;
long long k = 0ll;
cin >> A >> B >> T;
while(SM < T){
j = i * i;
i++;
SM = SM + A;
SM = SM + B * (j - k - 1);
k = j;
}
long long sa;
long long m;
if(SM - A >= T){
sa = SM - A - T;
m = sa / B;
k = k - m - 1;
}
cout << k << endl;
}

ステータス

項目 データ
問題 0993 - 貯金 (Saving Money)
ユーザー名 あび
投稿日時 2018-11-15 14:15:27
言語 C++14
状態 Accepted
得点 10
ソースコード長 420 Byte
最大実行時間 30 ms
最大メモリ使用量 744 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input-sample01 AC 27 ms 604 KB
1
input-sample02 AC 24 ms 580 KB
1
input-sample03 AC 23 ms 552 KB
1
input01 AC 27 ms 652 KB
1
input02 AC 24 ms 620 KB
1
input03 AC 21 ms 588 KB
1
input04 AC 21 ms 564 KB
1
input05 AC 18 ms 540 KB
1
input06 AC 18 ms 512 KB
1
input07 AC 18 ms 620 KB
1
input08 AC 18 ms 592 KB
1
input09 AC 27 ms 564 KB
1
input10 AC 17 ms 532 KB
1
input11 AC 24 ms 504 KB
1
input12 AC 20 ms 476 KB
1
input13 AC 23 ms 572 KB
1
input14 AC 18 ms 544 KB
1
input15 AC 21 ms 644 KB
1
input16 AC 21 ms 744 KB
1
input17 AC 24 ms 588 KB
1
input18 AC 20 ms 564 KB
1
input19 AC 21 ms 532 KB
1
input20 AC 18 ms 628 KB
1
input21 AC 21 ms 600 KB
1
input22 AC 22 ms 568 KB
1
input23 AC 25 ms 536 KB
1
input24 AC 19 ms 512 KB
1
input25 AC 23 ms 608 KB
1
input26 AC 21 ms 576 KB
1
input27 AC 26 ms 548 KB
1
input28 AC 25 ms 644 KB
1
input29 AC 21 ms 616 KB
1
input30 AC 30 ms 460 KB
1