ABC 046, finished

This commit is contained in:
2022-06-02 14:02:35 +02:00
parent fda6666069
commit 6c4f09de1c
2 changed files with 17 additions and 8 deletions

View File

@@ -11,7 +11,10 @@ fn main(){
let mut t = 1; let mut t = 1;
for (r_t, r_a) in ratios { for (r_t, r_a) in ratios {
let x = max((r_t + t - 1) / r_t, (r_a + a - 1) / r_a);
t = r_t * x;
a = r_a * x;
} }
println!("{}", {a + t});
} }

View File

@@ -1,15 +1,21 @@
use proconio::input; use proconio::input;
fn solve(tc: u32) {
todo!();
}
fn main(){ fn main(){
input!{ input!{
t: u32, s: String,
}; };
for tc in 1..=t { let mut counter = 0;
solve(tc);
for gesture in s.chars() {
if gesture == 'p' {
counter += 1;
} }
} }
let max_paper_hands = s.len() / 2;
let result = max_paper_hands - counter;
println!("{}", {result});
}