Skip to content

Commit e285cd1

Browse files
committed
Solve C in abc259
1 parent 67ddee2 commit e285cd1

File tree

16 files changed

+1105
-0
lines changed

16 files changed

+1105
-0
lines changed

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

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
s: Chars,
18+
t: Chars,
19+
}
20+
21+
let mut si = 0;
22+
let mut ti = 0;
23+
loop {
24+
if si == s.len() || ti == t.len() {
25+
if si != s.len() || ti != t.len() {
26+
return println!("No")
27+
}
28+
break
29+
}
30+
if s[si] != t[ti] {
31+
return println!("No")
32+
}
33+
34+
let mut si_count = 0;
35+
while si < s.len() - 1 && s[si] == s[si+1] {
36+
si += 1;
37+
si_count += 1;
38+
}
39+
let mut ti_count = 0;
40+
while ti < t.len() -1 && t[ti] == t[ti+1] {
41+
ti += 1;
42+
ti_count += 1;
43+
}
44+
if (si_count == 0 && ti_count > 0) || si_count > ti_count {
45+
return println!("No")
46+
}
47+
si += 1;
48+
ti += 1;
49+
}
50+
51+
println!("Yes")
52+
}

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

atcoder/rust/abc259/testcases/a.yml

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+
38 20 17 168 3
10+
out: |
11+
168
12+
- name: sample2
13+
in: |
14+
1 0 1 3 2
15+
out: |
16+
1
17+
- name: sample3
18+
in: |
19+
100 10 100 180 1
20+
out: |
21+
90
22+
23+
extend: []

atcoder/rust/abc259/testcases/b.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
type: Batch
3+
timelimit: 2s
4+
match:
5+
Float:
6+
relative_error: 0.000001
7+
absolute_error: 0.000001
8+
9+
cases:
10+
- name: sample1
11+
in: |
12+
2 2 180
13+
out: |
14+
-2 -2
15+
- name: sample2
16+
in: |
17+
5 0 120
18+
out: |
19+
-2.49999999999999911182 4.33012701892219364908
20+
- name: sample3
21+
in: |
22+
0 0 11
23+
out: |
24+
0.00000000000000000000 0.00000000000000000000
25+
- name: sample4
26+
in: |
27+
15 5 360
28+
out: |
29+
15.00000000000000177636 4.99999999999999555911
30+
- name: sample5
31+
in: |
32+
-505 191 278
33+
out: |
34+
118.85878514480690171240 526.66743699786547949770
35+
36+
extend: []

atcoder/rust/abc259/testcases/c.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
type: Batch
3+
timelimit: 2s
4+
match: Lines
5+
6+
cases:
7+
- name: sample1
8+
in: |
9+
abbaac
10+
abbbbaaac
11+
out: |
12+
Yes
13+
- name: sample2
14+
in: |
15+
xyzz
16+
xyyzz
17+
out: |
18+
No
19+
20+
extend: []

atcoder/rust/abc259/testcases/d.yml

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

atcoder/rust/abc259/testcases/e.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
type: Batch
3+
timelimit: 2s
4+
match: Lines
5+
6+
cases:
7+
- name: sample1
8+
in: |
9+
4
10+
1
11+
7 2
12+
2
13+
2 2
14+
5 1
15+
1
16+
5 1
17+
2
18+
2 1
19+
7 1
20+
out: |
21+
3
22+
- name: sample2
23+
in: |
24+
1
25+
1
26+
998244353 1000000000
27+
out: |
28+
1
29+
30+
extend: []

0 commit comments

Comments
 (0)