ABC 044, c and d unfinished

This commit is contained in:
2022-05-28 16:48:08 +02:00
parent 97ee8adbf3
commit e1bc9a42a2
6 changed files with 100 additions and 0 deletions

View 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});
}

View 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");
}

View 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
}

View File

@@ -0,0 +1,8 @@
use proconio::input;
fn main() {
input!{
n: u64,
s: u64,
};
}