Skip to content

Commit 4c96aeb

Browse files
committed
Solve C in abc258
1 parent 87cc151 commit 4c96aeb

File tree

16 files changed

+1103
-0
lines changed

16 files changed

+1103
-0
lines changed

atcoder/rust/abc258/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/abc258/Cargo.toml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[package]
2+
name = "abc258"
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 = "abc258-a", problem = { platform = "atcoder", contest = "abc258", index = "A", url = "https://atcoder.jp/contests/abc258/tasks/abc258_a" } }
12+
b = { name = "abc258-b", problem = { platform = "atcoder", contest = "abc258", index = "B", url = "https://atcoder.jp/contests/abc258/tasks/abc258_b" } }
13+
c = { name = "abc258-c", problem = { platform = "atcoder", contest = "abc258", index = "C", url = "https://atcoder.jp/contests/abc258/tasks/abc258_c" } }
14+
d = { name = "abc258-d", problem = { platform = "atcoder", contest = "abc258", index = "D", url = "https://atcoder.jp/contests/abc258/tasks/abc258_d" } }
15+
e = { name = "abc258-e", problem = { platform = "atcoder", contest = "abc258", index = "E", url = "https://atcoder.jp/contests/abc258/tasks/abc258_e" } }
16+
f = { name = "abc258-f", problem = { platform = "atcoder", contest = "abc258", index = "F", url = "https://atcoder.jp/contests/abc258/tasks/abc258_f" } }
17+
g = { name = "abc258-g", problem = { platform = "atcoder", contest = "abc258", index = "G", url = "https://atcoder.jp/contests/abc258/tasks/abc258_g" } }
18+
19+
[[bin]]
20+
name = "abc258-a"
21+
path = "src/bin/a.rs"
22+
23+
[[bin]]
24+
name = "abc258-b"
25+
path = "src/bin/b.rs"
26+
27+
[[bin]]
28+
name = "abc258-c"
29+
path = "src/bin/c.rs"
30+
31+
[[bin]]
32+
name = "abc258-d"
33+
path = "src/bin/d.rs"
34+
35+
[[bin]]
36+
name = "abc258-e"
37+
path = "src/bin/e.rs"
38+
39+
[[bin]]
40+
name = "abc258-f"
41+
path = "src/bin/f.rs"
42+
43+
[[bin]]
44+
name = "abc258-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/abc258/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/abc258/src/bin/b.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/abc258/src/bin/c.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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, q: usize,
18+
s: Chars,
19+
queries: [(usize, i64); q],
20+
}
21+
22+
let mut moved_count: i64 = 0;
23+
for (op, x) in queries {
24+
match op {
25+
1 => moved_count = (moved_count + x) % n as i64,
26+
2 => {
27+
let i = if x > moved_count {
28+
(x - 1 - moved_count) as usize
29+
} else {
30+
n - (x - 1 - moved_count).abs() as usize
31+
};
32+
println!("{}", s[i])
33+
}
34+
_ => {}
35+
}
36+
}
37+
}

atcoder/rust/abc258/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/abc258/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/abc258/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+
}

atcoder/rust/abc258/src/bin/g.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+
63
10+
out: |
11+
22:03
12+
- name: sample2
13+
in: |
14+
45
15+
out: |
16+
21:45
17+
- name: sample3
18+
in: |
19+
100
20+
out: |
21+
22:40
22+
23+
extend: []

0 commit comments

Comments
 (0)