Skip to content

Commit 19b8ea8

Browse files
committed
Solve C in abc260
1 parent c04461a commit 19b8ea8

File tree

16 files changed

+1165
-0
lines changed

16 files changed

+1165
-0
lines changed

atcoder/rust/abc260/Cargo.lock

+638
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

atcoder/rust/abc260/Cargo.toml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[package]
2+
name = "abc260"
3+
version = "0.1.0"
4+
authors = ["k-yomo <kanji.yy@gmail.com>"]
5+
edition = "2018"
6+
7+
[package.metadata.cargo-compete]
8+
config = "../compete.toml"
9+
10+
[package.metadata.cargo-compete.bin]
11+
a = { name = "abc260-a", problem = { platform = "atcoder", contest = "abc260", index = "A", url = "https://atcoder.jp/contests/abc260/tasks/abc260_a" } }
12+
b = { name = "abc260-b", problem = { platform = "atcoder", contest = "abc260", index = "B", url = "https://atcoder.jp/contests/abc260/tasks/abc260_b" } }
13+
c = { name = "abc260-c", problem = { platform = "atcoder", contest = "abc260", index = "C", url = "https://atcoder.jp/contests/abc260/tasks/abc260_c" } }
14+
d = { name = "abc260-d", problem = { platform = "atcoder", contest = "abc260", index = "D", url = "https://atcoder.jp/contests/abc260/tasks/abc260_d" } }
15+
e = { name = "abc260-e", problem = { platform = "atcoder", contest = "abc260", index = "E", url = "https://atcoder.jp/contests/abc260/tasks/abc260_e" } }
16+
f = { name = "abc260-f", problem = { platform = "atcoder", contest = "abc260", index = "F", url = "https://atcoder.jp/contests/abc260/tasks/abc260_f" } }
17+
g = { name = "abc260-g", problem = { platform = "atcoder", contest = "abc260", index = "G", url = "https://atcoder.jp/contests/abc260/tasks/abc260_g" } }
18+
19+
[[bin]]
20+
name = "abc260-a"
21+
path = "src/bin/a.rs"
22+
23+
[[bin]]
24+
name = "abc260-b"
25+
path = "src/bin/b.rs"
26+
27+
[[bin]]
28+
name = "abc260-c"
29+
path = "src/bin/c.rs"
30+
31+
[[bin]]
32+
name = "abc260-d"
33+
path = "src/bin/d.rs"
34+
35+
[[bin]]
36+
name = "abc260-e"
37+
path = "src/bin/e.rs"
38+
39+
[[bin]]
40+
name = "abc260-f"
41+
path = "src/bin/f.rs"
42+
43+
[[bin]]
44+
name = "abc260-g"
45+
path = "src/bin/g.rs"
46+
[dependencies]
47+
num = "=0.2.1"
48+
num-bigint = "=0.2.6"
49+
num-complex = "=0.2.4"
50+
num-integer = "=0.1.42"
51+
num-iter = "=0.1.40"
52+
num-rational = "=0.2.4"
53+
num-traits = "=0.2.11"
54+
num-derive = "=0.3.0"
55+
ndarray = "=0.13.0"
56+
nalgebra = "=0.20.0"
57+
alga = "=0.9.3"
58+
libm = "=0.2.1"
59+
rand = { version = "=0.7.3", features = ["small_rng"] }
60+
getrandom = "=0.1.14"
61+
rand_chacha = "=0.2.2"
62+
rand_core = "=0.5.1"
63+
rand_hc = "=0.2.0"
64+
rand_pcg = "=0.2.1"
65+
rand_distr = "=0.2.2"
66+
petgraph = "=0.5.0"
67+
indexmap = "=1.3.2"
68+
regex = "=1.3.6"
69+
lazy_static = "=1.4.0"
70+
ordered-float = "=1.0.2"
71+
ascii = "=1.0.0"
72+
permutohedron = "=0.2.4"
73+
superslice = "=1.0.0"
74+
itertools = "=0.9.0"
75+
itertools-num = "=0.1.3"
76+
maplit = "=1.0.2"
77+
either = "=1.5.3"
78+
im-rc = "=14.3.0"
79+
fixedbitset = "=0.2.0"
80+
bitset-fixed = "=0.1.0"
81+
proconio = { version = "=0.3.6", features = ["derive"] }
82+
text_io = "=0.1.8"
83+
whiteread = "=0.5.0"
84+
rustc-hash = "=1.1.0"
85+
smallvec = "=1.2.0"

atcoder/rust/abc260/src/bin/a.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![allow(unused_imports)]
2+
3+
use std::cmp::*;
4+
use std::collections::*;
5+
use std::io::Write;
6+
use std::ops::Bound::*;
7+
8+
use itertools::*;
9+
use itertools::__std_iter::once;
10+
use itertools_num::ItertoolsNum;
11+
use proconio::*;
12+
use proconio::marker::*;
13+
use superslice::*;
14+
15+
fn main() {
16+
input! {
17+
18+
}
19+
}

atcoder/rust/abc260/src/bin/b.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![allow(unused_imports)]
2+
3+
use std::cmp::*;
4+
use std::collections::*;
5+
use std::io::Write;
6+
use std::ops::Bound::*;
7+
8+
use itertools::*;
9+
use itertools::__std_iter::once;
10+
use itertools_num::ItertoolsNum;
11+
use proconio::*;
12+
use proconio::marker::*;
13+
use superslice::*;
14+
15+
fn main() {
16+
input! {
17+
18+
}
19+
}

atcoder/rust/abc260/src/bin/c.rs

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#![allow(unused_imports)]
2+
3+
use std::cmp::*;
4+
use std::collections::*;
5+
use std::io::Write;
6+
use std::ops::Bound::*;
7+
8+
use itertools::*;
9+
use itertools::__std_iter::once;
10+
use itertools_num::ItertoolsNum;
11+
use proconio::*;
12+
use proconio::marker::*;
13+
use superslice::*;
14+
15+
fn main() {
16+
input! {
17+
n: usize, x: usize, y: usize,
18+
}
19+
20+
let mut level1_brew_count = 0;
21+
let mut queue = VecDeque::new();
22+
queue.push_back((0, n, 1));
23+
loop {
24+
if queue.is_empty() {
25+
break
26+
}
27+
let (color, level, count) = queue.pop_front().unwrap();
28+
if color == 0 {
29+
if level > 1 {
30+
queue.push_back((0, level - 1, count));
31+
queue.push_back((1, level, x * count));
32+
}
33+
} else {
34+
if level > 1 {
35+
queue.push_back((1, level - 1, y * count));
36+
queue.push_back((0, level - 1, count));
37+
} else {
38+
level1_brew_count += count;
39+
}
40+
}
41+
}
42+
43+
println!("{}", level1_brew_count)
44+
}

atcoder/rust/abc260/src/bin/d.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![allow(unused_imports)]
2+
3+
use std::cmp::*;
4+
use std::collections::*;
5+
use std::io::Write;
6+
use std::ops::Bound::*;
7+
8+
use itertools::*;
9+
use itertools::__std_iter::once;
10+
use itertools_num::ItertoolsNum;
11+
use proconio::*;
12+
use proconio::marker::*;
13+
use superslice::*;
14+
15+
fn main() {
16+
input! {
17+
18+
}
19+
}

atcoder/rust/abc260/src/bin/e.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![allow(unused_imports)]
2+
3+
use std::cmp::*;
4+
use std::collections::*;
5+
use std::io::Write;
6+
use std::ops::Bound::*;
7+
8+
use itertools::*;
9+
use itertools::__std_iter::once;
10+
use itertools_num::ItertoolsNum;
11+
use proconio::*;
12+
use proconio::marker::*;
13+
use superslice::*;
14+
15+
fn main() {
16+
input! {
17+
18+
}
19+
}

atcoder/rust/abc260/src/bin/f.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![allow(unused_imports)]
2+
3+
use std::cmp::*;
4+
use std::collections::*;
5+
use std::io::Write;
6+
use std::ops::Bound::*;
7+
8+
use itertools::*;
9+
use itertools::__std_iter::once;
10+
use itertools_num::ItertoolsNum;
11+
use proconio::*;
12+
use proconio::marker::*;
13+
use superslice::*;
14+
15+
fn main() {
16+
input! {
17+
18+
}
19+
}

atcoder/rust/abc260/src/bin/g.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![allow(unused_imports)]
2+
3+
use std::cmp::*;
4+
use std::collections::*;
5+
use std::io::Write;
6+
use std::ops::Bound::*;
7+
8+
use itertools::*;
9+
use itertools::__std_iter::once;
10+
use itertools_num::ItertoolsNum;
11+
use proconio::*;
12+
use proconio::marker::*;
13+
use superslice::*;
14+
15+
fn main() {
16+
input! {
17+
18+
}
19+
}

atcoder/rust/abc260/testcases/a.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
type: Batch
3+
timelimit: 2s
4+
match: Lines
5+
6+
cases:
7+
- name: sample1
8+
in: |
9+
pop
10+
out: |
11+
o
12+
- name: sample2
13+
in: |
14+
abc
15+
out: |
16+
a
17+
- name: sample3
18+
in: |
19+
xxx
20+
out: |
21+
-1
22+
23+
extend: []

atcoder/rust/abc260/testcases/b.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
type: Batch
3+
timelimit: 2s
4+
match: Lines
5+
6+
cases:
7+
- name: sample1
8+
in: |
9+
6 1 0 2
10+
80 60 80 60 70 70
11+
40 20 50 90 90 80
12+
out: |
13+
1
14+
4
15+
5
16+
- name: sample2
17+
in: |
18+
5 2 1 2
19+
0 100 0 100 0
20+
0 0 100 100 0
21+
out: |
22+
1
23+
2
24+
3
25+
4
26+
5
27+
- name: sample3
28+
in: |
29+
15 4 3 2
30+
30 65 20 95 100 45 70 85 20 35 95 50 40 15 85
31+
0 25 45 35 65 70 80 90 40 55 20 20 45 75 100
32+
out: |
33+
2
34+
4
35+
5
36+
6
37+
7
38+
8
39+
11
40+
14
41+
15
42+
43+
extend: []

atcoder/rust/abc260/testcases/c.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
type: Batch
3+
timelimit: 2s
4+
match: Lines
5+
6+
cases:
7+
- name: sample1
8+
in: |
9+
2 3 4
10+
out: |
11+
12
12+
- name: sample2
13+
in: |
14+
1 5 5
15+
out: |
16+
0
17+
- name: sample3
18+
in: |
19+
10 5 5
20+
out: |
21+
3942349900
22+
23+
extend: []

atcoder/rust/abc260/testcases/d.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
type: Batch
3+
timelimit: 2s
4+
match: Lines
5+
6+
cases:
7+
- name: sample1
8+
in: |
9+
5 2
10+
3 5 2 1 4
11+
out: |
12+
4
13+
3
14+
3
15+
-1
16+
4
17+
- name: sample2
18+
in: |
19+
5 1
20+
1 2 3 4 5
21+
out: |
22+
1
23+
2
24+
3
25+
4
26+
5
27+
- name: sample3
28+
in: |
29+
15 3
30+
3 14 15 9 2 6 5 13 1 7 10 11 8 12 4
31+
out: |
32+
9
33+
9
34+
9
35+
15
36+
15
37+
6
38+
-1
39+
-1
40+
6
41+
-1
42+
-1
43+
-1
44+
-1
45+
6
46+
15
47+
48+
extend: []

0 commit comments

Comments
 (0)