add cf ecr-188 ABCDE

This commit is contained in:
2026-03-17 02:04:38 +09:00
parent caa37de30f
commit 3c0fa0eff8
5 changed files with 203 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
use std::io::{read_to_string, stdin};
fn main() {
let temp = read_to_string(stdin()).unwrap();
let mut iter = temp
.split_ascii_whitespace()
.map(|x| x.parse::<usize>().unwrap());
let t = iter.next().unwrap();
(0..t).for_each(|_| {
let n = iter.next().unwrap();
let arr = (0..n).map(|_| iter.next().unwrap()).collect::<Vec<_>>();
let mut cnt = 0;
let mut before_most = 0;
for i in 0..n {
if arr[i] > before_most {
cnt += 1;
before_most = arr[i];
} else if arr[i] == before_most {
cnt += 1;
}
}
println!("{}", cnt);
});
}