File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ // https://atcoder.jp/contests/abc165/tasks/abc165_b
2
+ //
3
+ // 以下のクレートを使用。
4
+ // - `itertools`
5
+ // - `proconio`
6
+
7
+ use proconio:: input;
8
+
9
+ fn main ( ) {
10
+ // `proconio::input!`。
11
+ //
12
+ // https://docs.rs/proconio/0.3.6/proconio/macro.input.html
13
+ input ! {
14
+ x: u64 ,
15
+ }
16
+
17
+ // `itertools::iterate`は`std::iter::successors`の`Some`固定版。
18
+ // 「X円一歩手前」で打ち切ったものを`count`するとちょうど答えになる。
19
+ //
20
+ // https://docs.rs/itertools/0.9.0/itertools/fn.iterate.html
21
+ let ans = itertools:: iterate ( 100 , |m| m + m / 100 )
22
+ . take_while ( |& m| m < x)
23
+ . count ( ) ;
24
+
25
+ println ! ( "{}" , ans) ;
26
+ }
Original file line number Diff line number Diff line change @@ -233,6 +233,13 @@ url = "https://atcoder.jp/contests/abc162/tasks/abc162_c"
233
233
matching = " Words"
234
234
meta = { using = [" itertools" , " num" , " proconio" ] }
235
235
236
+ [examples .abc165-b ]
237
+ type = " Normal"
238
+ name = " ABC165 - B - 1%"
239
+ url = " https://atcoder.jp/contests/abc165/tasks/abc165_b"
240
+ matching = " Words"
241
+ meta = { using = [" itertools" , " proconio" ] }
242
+
236
243
[examples .agc020-c ]
237
244
type = " Normal"
238
245
name = " AGC020: C - Median Sum"
You can’t perform that action at this time.
0 commit comments