Skip to content

Commit 9b42d13

Browse files
committed
Solve B in arc142
1 parent 4c96aeb commit 9b42d13

File tree

14 files changed

+1069
-0
lines changed

14 files changed

+1069
-0
lines changed

atcoder/rust/arc142/Cargo.lock

Lines changed: 638 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

atcoder/rust/arc142/Cargo.toml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
[package]
2+
name = "arc142"
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 = "arc142-a", problem = { platform = "atcoder", contest = "arc142", index = "A", url = "https://atcoder.jp/contests/arc142/tasks/arc142_a" } }
12+
b = { name = "arc142-b", problem = { platform = "atcoder", contest = "arc142", index = "B", url = "https://atcoder.jp/contests/arc142/tasks/arc142_b" } }
13+
c = { name = "arc142-c", problem = { platform = "atcoder", contest = "arc142", index = "C", url = "https://atcoder.jp/contests/arc142/tasks/arc142_c" } }
14+
d = { name = "arc142-d", problem = { platform = "atcoder", contest = "arc142", index = "D", url = "https://atcoder.jp/contests/arc142/tasks/arc142_d" } }
15+
e = { name = "arc142-e", problem = { platform = "atcoder", contest = "arc142", index = "E", url = "https://atcoder.jp/contests/arc142/tasks/arc142_e" } }
16+
f = { name = "arc142-f", problem = { platform = "atcoder", contest = "arc142", index = "F", url = "https://atcoder.jp/contests/arc142/tasks/arc142_f" } }
17+
18+
[[bin]]
19+
name = "arc142-a"
20+
path = "src/bin/a.rs"
21+
22+
[[bin]]
23+
name = "arc142-b"
24+
path = "src/bin/b.rs"
25+
26+
[[bin]]
27+
name = "arc142-c"
28+
path = "src/bin/c.rs"
29+
30+
[[bin]]
31+
name = "arc142-d"
32+
path = "src/bin/d.rs"
33+
34+
[[bin]]
35+
name = "arc142-e"
36+
path = "src/bin/e.rs"
37+
38+
[[bin]]
39+
name = "arc142-f"
40+
path = "src/bin/f.rs"
41+
[dependencies]
42+
num = "=0.2.1"
43+
num-bigint = "=0.2.6"
44+
num-complex = "=0.2.4"
45+
num-integer = "=0.1.42"
46+
num-iter = "=0.1.40"
47+
num-rational = "=0.2.4"
48+
num-traits = "=0.2.11"
49+
num-derive = "=0.3.0"
50+
ndarray = "=0.13.0"
51+
nalgebra = "=0.20.0"
52+
alga = "=0.9.3"
53+
libm = "=0.2.1"
54+
rand = { version = "=0.7.3", features = ["small_rng"] }
55+
getrandom = "=0.1.14"
56+
rand_chacha = "=0.2.2"
57+
rand_core = "=0.5.1"
58+
rand_hc = "=0.2.0"
59+
rand_pcg = "=0.2.1"
60+
rand_distr = "=0.2.2"
61+
petgraph = "=0.5.0"
62+
indexmap = "=1.3.2"
63+
regex = "=1.3.6"
64+
lazy_static = "=1.4.0"
65+
ordered-float = "=1.0.2"
66+
ascii = "=1.0.0"
67+
permutohedron = "=0.2.4"
68+
superslice = "=1.0.0"
69+
itertools = "=0.9.0"
70+
itertools-num = "=0.1.3"
71+
maplit = "=1.0.2"
72+
either = "=1.5.3"
73+
im-rc = "=14.3.0"
74+
fixedbitset = "=0.2.0"
75+
bitset-fixed = "=0.1.0"
76+
proconio = { version = "=0.3.6", features = ["derive"] }
77+
text_io = "=0.1.8"
78+
whiteread = "=0.5.0"
79+
rustc-hash = "=1.1.0"
80+
smallvec = "=1.2.0"

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

Lines changed: 19 additions & 0 deletions
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/arc142/src/bin/b.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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,
18+
}
19+
20+
for i in 1..=n {
21+
let mut nums = vec![];
22+
let mut reverse = false;
23+
let mut i = 0;
24+
let mut count = 0;
25+
while count < n {
26+
if reverse {
27+
print!("{} ", nums[n-i-1]);
28+
i += 1;
29+
} else {
30+
print!("{} ", nums[i]);
31+
}
32+
count += 1;
33+
reverse = !reverse;
34+
}
35+
println!(nums.map(|i| i.to_string()).jon(" "))
36+
}
37+
}
38+
39+

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

Lines changed: 19 additions & 0 deletions
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/arc142/src/bin/d.rs

Lines changed: 19 additions & 0 deletions
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/arc142/src/bin/e.rs

Lines changed: 19 additions & 0 deletions
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/arc142/src/bin/f.rs

Lines changed: 19 additions & 0 deletions
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+
}
Lines changed: 23 additions & 0 deletions
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+
1420 142
10+
out: |
11+
3
12+
- name: sample2
13+
in: |
14+
1419 142
15+
out: |
16+
2
17+
- name: sample3
18+
in: |
19+
6 19
20+
out: |
21+
0
22+
23+
extend: []
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
type: Batch
3+
timelimit: 2s
4+
match: Lines
5+
6+
cases:
7+
- name: sample1
8+
in: |
9+
2
10+
out: |
11+
1 2
12+
3 4
13+
- name: sample2
14+
in: |
15+
3
16+
out: |
17+
1 2 3
18+
5 4 6
19+
7 8 9
20+
21+
extend: []

0 commit comments

Comments
 (0)