Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
d170dcba-0259-4f5e-9c6c-6981ab637fd3 1, 2, 3, 5
- Loading branch information
Showing
14 changed files
with
977 additions
and
0 deletions.
There are no files selected for viewing
632 changes: 632 additions & 0 deletions
632
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/Cargo.lock
Large diffs are not rendered by default.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
[package] | ||
name = "d170dcba-0259-4f5e-9c6c-6981ab637fd3" | ||
version = "0.1.0" | ||
authors = ["bouzuya <m@bouzuya.net>"] | ||
edition = "2018" | ||
|
||
[package.metadata.cargo-compete.bin] | ||
d170dcba-0259-4f5e-9c6c-6981ab637fd3-1 = { alias = "1", problem = "https://atcoder.jp/contests/abc213/tasks/abc213_a" } | ||
d170dcba-0259-4f5e-9c6c-6981ab637fd3-2 = { alias = "2", problem = "https://atcoder.jp/contests/abl/tasks/abl_b" } | ||
d170dcba-0259-4f5e-9c6c-6981ab637fd3-3 = { alias = "3", problem = "https://atcoder.jp/contests/abc072/tasks/arc082_a" } | ||
d170dcba-0259-4f5e-9c6c-6981ab637fd3-4 = { alias = "4", problem = "https://atcoder.jp/contests/agc038/tasks/agc038_a" } | ||
d170dcba-0259-4f5e-9c6c-6981ab637fd3-5 = { alias = "5", problem = "https://atcoder.jp/contests/zone2021/tasks/zone2021_c" } | ||
d170dcba-0259-4f5e-9c6c-6981ab637fd3-6 = { alias = "6", problem = "https://atcoder.jp/contests/abc171/tasks/abc171_f" } | ||
|
||
[[bin]] | ||
name = "d170dcba-0259-4f5e-9c6c-6981ab637fd3-1" | ||
path = "src/bin/1.rs" | ||
|
||
[[bin]] | ||
name = "d170dcba-0259-4f5e-9c6c-6981ab637fd3-2" | ||
path = "src/bin/2.rs" | ||
|
||
[[bin]] | ||
name = "d170dcba-0259-4f5e-9c6c-6981ab637fd3-3" | ||
path = "src/bin/3.rs" | ||
|
||
[[bin]] | ||
name = "d170dcba-0259-4f5e-9c6c-6981ab637fd3-4" | ||
path = "src/bin/4.rs" | ||
|
||
[[bin]] | ||
name = "d170dcba-0259-4f5e-9c6c-6981ab637fd3-5" | ||
path = "src/bin/5.rs" | ||
|
||
[[bin]] | ||
name = "d170dcba-0259-4f5e-9c6c-6981ab637fd3-6" | ||
path = "src/bin/6.rs" | ||
[dependencies] | ||
num = "=0.2.1" | ||
num-bigint = "=0.2.6" | ||
num-complex = "=0.2.4" | ||
num-integer = "=0.1.42" | ||
num-iter = "=0.1.40" | ||
num-rational = "=0.2.4" | ||
num-traits = "=0.2.11" | ||
num-derive = "=0.3.0" | ||
ndarray = "=0.13.0" | ||
nalgebra = "=0.20.0" | ||
alga = "=0.9.3" | ||
libm = "=0.2.1" | ||
rand = { version = "=0.7.3", features = ["small_rng"] } | ||
getrandom = "=0.1.14" | ||
rand_chacha = "=0.2.2" | ||
rand_core = "=0.5.1" | ||
rand_hc = "=0.2.0" | ||
rand_pcg = "=0.2.1" | ||
rand_distr = "=0.2.2" | ||
petgraph = "=0.5.0" | ||
indexmap = "=1.3.2" | ||
regex = "=1.3.6" | ||
lazy_static = "=1.4.0" | ||
ordered-float = "=1.0.2" | ||
ascii = "=1.0.0" | ||
permutohedron = "=0.2.4" | ||
superslice = "=1.0.0" | ||
itertools = "=0.9.0" | ||
itertools-num = "=0.1.3" | ||
maplit = "=1.0.2" | ||
either = "=1.5.3" | ||
im-rc = "=14.3.0" | ||
fixedbitset = "=0.2.0" | ||
bitset-fixed = "=0.1.0" | ||
proconio = { version = "=0.3.6", features = ["derive"] } | ||
text_io = "=0.1.8" | ||
whiteread = "=0.5.0" | ||
rustc-hash = "=1.1.0" | ||
smallvec = "=1.2.0" | ||
[dev-dependencies] |
14 changes: 14 additions & 0 deletions
14
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/src/bin/1.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use proconio::input; | ||
|
||
fn main() { | ||
input! { | ||
a: usize, | ||
b: usize, | ||
} | ||
for c in 0..=255 { | ||
if a ^ b == c { | ||
println!("{}", c); | ||
return; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/src/bin/2.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use proconio::input; | ||
|
||
fn main() { | ||
input! { | ||
a: usize, | ||
b: usize, | ||
c: usize, | ||
d: usize, | ||
} | ||
let ans = !(d < a || b < c); | ||
println!("{}", if ans { "Yes" } else { "No" }); | ||
} |
19 changes: 19 additions & 0 deletions
19
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/src/bin/3.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::collections::BTreeMap; | ||
|
||
use proconio::input; | ||
|
||
fn main() { | ||
input! { | ||
n: usize, | ||
a: [i64; n], | ||
} | ||
let mut count = BTreeMap::new(); | ||
for a_i in a { | ||
*count.entry(a_i - 1).or_insert(0) += 1; | ||
*count.entry(a_i).or_insert(0) += 1; | ||
*count.entry(a_i + 1).or_insert(0) += 1; | ||
} | ||
|
||
let ans = *count.values().max().unwrap(); | ||
println!("{}", ans); | ||
} |
10 changes: 10 additions & 0 deletions
10
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/src/bin/4.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use proconio::input; | ||
|
||
fn main() { | ||
input! { | ||
n: usize, | ||
} | ||
todo!(); | ||
let ans = n; | ||
println!("{}", ans); | ||
} |
49 changes: 49 additions & 0 deletions
49
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/src/bin/5.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use proconio::input; | ||
|
||
macro_rules! chmin { | ||
($min_v: expr, $v: expr) => { | ||
if $v < $min_v { | ||
$min_v = $v; | ||
true | ||
} else { | ||
false | ||
} | ||
}; | ||
} | ||
|
||
fn is_ok(abcde: &[(usize, usize, usize, usize, usize)], x: usize) -> bool { | ||
let inf = abcde.len() + 1; | ||
let mut dp = vec![inf; 1 << 5]; | ||
dp[0] = 0; | ||
for (a_i, b_i, c_i, d_i, e_i) in abcde.iter().copied() { | ||
let mut mask = 0; | ||
mask |= if a_i > x { 1 << 4 } else { 0 }; | ||
mask |= if b_i > x { 1 << 3 } else { 0 }; | ||
mask |= if c_i > x { 1 << 2 } else { 0 }; | ||
mask |= if d_i > x { 1 << 1 } else { 0 }; | ||
mask |= if e_i > x { 1 << 0 } else { 0 }; | ||
for j in 0..1 << 5 { | ||
chmin!(dp[j | mask], dp[j] + 1); | ||
} | ||
} | ||
dp[0b11111] <= 3 | ||
} | ||
|
||
fn main() { | ||
input! { | ||
n: usize, | ||
abcde: [(usize, usize, usize, usize, usize); n], | ||
} | ||
let mut ok = 0; | ||
let mut ng = 1_000_000_001; | ||
while ng - ok > 1 { | ||
let x = (ok + ng) / 2; | ||
if is_ok(&abcde, x) { | ||
ok = x; | ||
} else { | ||
ng = x; | ||
} | ||
} | ||
let ans = ok + 1; | ||
println!("{}", ans); | ||
} |
10 changes: 10 additions & 0 deletions
10
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/src/bin/6.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use proconio::input; | ||
|
||
fn main() { | ||
input! { | ||
n: usize, | ||
} | ||
todo!(); | ||
let ans = n; | ||
println!("{}", ans); | ||
} |
20 changes: 20 additions & 0 deletions
20
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/testcases/1.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
type: Batch | ||
timelimit: ~ | ||
match: Exact | ||
|
||
cases: | ||
- in: | | ||
3 6 | ||
out: | | ||
5 | ||
- in: | | ||
10 12 | ||
out: | | ||
6 | ||
extend: | ||
- type: Text | ||
path: "./1" | ||
in: /in/*.txt | ||
out: /out/*.txt |
20 changes: 20 additions & 0 deletions
20
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/testcases/2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
type: Batch | ||
timelimit: ~ | ||
match: Exact | ||
|
||
cases: | ||
- in: | | ||
10 30 20 40 | ||
out: | | ||
Yes | ||
- in: | | ||
10 20 30 40 | ||
out: | | ||
No | ||
extend: | ||
- type: Text | ||
path: "./2" | ||
in: /in/*.txt | ||
out: /out/*.txt |
27 changes: 27 additions & 0 deletions
27
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/testcases/3.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
type: Batch | ||
timelimit: ~ | ||
match: Exact | ||
|
||
cases: | ||
- in: | | ||
7 | ||
3 1 4 1 5 9 2 | ||
out: | | ||
4 | ||
- in: | | ||
10 | ||
0 1 2 3 4 5 6 7 8 9 | ||
out: | | ||
3 | ||
- in: | | ||
1 | ||
99999 | ||
out: | | ||
1 | ||
extend: | ||
- type: Text | ||
path: "./3" | ||
in: /in/*.txt | ||
out: /out/*.txt |
22 changes: 22 additions & 0 deletions
22
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/testcases/4.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
type: Batch | ||
timelimit: ~ | ||
match: Exact | ||
|
||
cases: | ||
- in: | | ||
3 3 1 1 | ||
out: | | ||
100 | ||
010 | ||
001 | ||
- in: | | ||
1 5 2 0 | ||
out: | | ||
01010 | ||
extend: | ||
- type: Text | ||
path: "./4" | ||
in: /in/*.txt | ||
out: /out/*.txt |
42 changes: 42 additions & 0 deletions
42
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/testcases/5.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
type: Batch | ||
timelimit: ~ | ||
match: Exact | ||
|
||
cases: | ||
- in: | | ||
3 | ||
3 9 6 4 6 | ||
6 9 3 1 1 | ||
8 8 9 3 7 | ||
out: | | ||
4 | ||
- in: | | ||
5 | ||
6 13 6 19 11 | ||
4 4 12 11 18 | ||
20 7 19 2 5 | ||
15 5 12 20 7 | ||
8 7 6 18 5 | ||
out: | | ||
13 | ||
- in: | | ||
10 | ||
6 7 5 18 2 | ||
3 8 1 6 3 | ||
7 2 8 7 7 | ||
6 3 3 4 7 | ||
12 8 9 15 9 | ||
9 8 6 1 10 | ||
12 9 7 8 2 | ||
10 3 17 4 10 | ||
3 1 3 19 3 | ||
3 14 7 13 1 | ||
out: | | ||
10 | ||
extend: | ||
- type: Text | ||
path: "./5" | ||
in: /in/*.txt | ||
out: /out/*.txt |
22 changes: 22 additions & 0 deletions
22
atcoder-problems-virtual-contests/d170dcba-0259-4f5e-9c6c-6981ab637fd3/testcases/6.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
type: Batch | ||
timelimit: ~ | ||
match: Exact | ||
|
||
cases: | ||
- in: | | ||
5 | ||
oof | ||
out: | | ||
575111451 | ||
- in: | | ||
37564 | ||
whydidyoudesertme | ||
out: | | ||
318008117 | ||
extend: | ||
- type: Text | ||
path: "./6" | ||
in: /in/*.txt | ||
out: /out/*.txt |