→ Source

#![allow(unused_imports)] use std::cmp::*; use std::collections::*; struct Scanner { buffer : std::collections::VecDeque<String> } impl Scanner { fn new() -> Scanner { Scanner { buffer: std::collections::VecDeque::new() } } fn next<T : std::str::FromStr >(&mut self) -> T { if self.buffer.len() == 0 { let mut input = String::new(); std::io::stdin().read_line(&mut input).ok(); for word in input.split_whitespace() { self.buffer.push_back(word.to_string()) } } let front = self.buffer.pop_front().unwrap(); front.parse::<T>().ok().unwrap() } } const N : usize = 100000; fn main() { let mut s = Scanner::new(); let mut a = [0i32; N]; let n : usize = s.next(); for i in 0..n { a[i] = s.next(); } let mut m = 1; let mut c = 1; for i in 0..(n-1) { if a[i+1] > a[i] { c += 1; } else { c = 1 } m = max(m, c); } println!("{}", m); }