ABC 046, finished
This commit is contained in:
@@ -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});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user