ABC 044, c and d unfinished
This commit is contained in:
25
atcoder/beginner_contests/abc044/Cargo.lock
generated
Normal file
25
atcoder/beginner_contests/abc044/Cargo.lock
generated
Normal file
@@ -0,0 +1,25 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "abc044"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"proconio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
|
||||
[[package]]
|
||||
name = "proconio"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91c333be3af2936f8e810300bc74fe4d0cc168ebc04ab02a28c5b1060fa1bd59"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
12
atcoder/beginner_contests/abc044/Cargo.toml
Normal file
12
atcoder/beginner_contests/abc044/Cargo.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "abc044"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# dependencies added to new project
|
||||
[dependencies]
|
||||
proconio = "0.4.3"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
panic = 'abort'
|
||||
19
atcoder/beginner_contests/abc044/src/bin/a.rs
Normal file
19
atcoder/beginner_contests/abc044/src/bin/a.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use proconio::input;
|
||||
|
||||
fn main() {
|
||||
input!{
|
||||
n: u32,
|
||||
k: u32,
|
||||
x: u32,
|
||||
y: u32,
|
||||
};
|
||||
|
||||
let result;
|
||||
if n > k {
|
||||
result = x * k + y * (n - k);
|
||||
} else {
|
||||
result = x * n;
|
||||
}
|
||||
|
||||
println!("{}", {result});
|
||||
}
|
||||
22
atcoder/beginner_contests/abc044/src/bin/b.rs
Normal file
22
atcoder/beginner_contests/abc044/src/bin/b.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use proconio::input;
|
||||
|
||||
fn main() {
|
||||
input!{
|
||||
w: String,
|
||||
};
|
||||
|
||||
let mut counts = [0; 26];
|
||||
for c in w.chars() {
|
||||
let i = c.to_digit(36).unwrap();
|
||||
counts[(i - 10) as usize] += 1;
|
||||
}
|
||||
|
||||
for count in counts.iter() {
|
||||
if count % 2 != 0 {
|
||||
println!("No");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
println!("Yes");
|
||||
}
|
||||
14
atcoder/beginner_contests/abc044/src/bin/c.rs
Normal file
14
atcoder/beginner_contests/abc044/src/bin/c.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use proconio::input;
|
||||
|
||||
fn main() {
|
||||
input!{
|
||||
n: u64,
|
||||
a: u64,
|
||||
x: [u64; n],
|
||||
};
|
||||
|
||||
// Naively one would find out all ways in which to make an average with value a,
|
||||
// and then simply multiply 2^y - 1 for all occurrences of the needed values
|
||||
// But I guess that wouldn't work, for multiple reasons
|
||||
// Probably need some dynamic program, god forbid I don't know how to make such a one for this
|
||||
}
|
||||
8
atcoder/beginner_contests/abc044/src/bin/d.rs
Normal file
8
atcoder/beginner_contests/abc044/src/bin/d.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use proconio::input;
|
||||
|
||||
fn main() {
|
||||
input!{
|
||||
n: u64,
|
||||
s: u64,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user