Submission #1692429


Source Code Expand

#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};

mod util {
    use std::io::stdin;
    use std::str::FromStr;
    use std::fmt::Debug;

    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }

    #[allow(dead_code)]
    pub fn get<T: FromStr>() -> T
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    }

    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }

    #[allow(dead_code)]
    pub fn get2<T: FromStr, U: FromStr>() -> (T, U)
    where
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }

    #[allow(dead_code)]
    pub fn get3<S: FromStr, T: FromStr, U: FromStr>() -> (S, T, U)
    where
        <S as FromStr>::Err: Debug,
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }
}

// std::cmp::Reverse doesn't have Clone.
#[derive(Eq, PartialEq, Clone)]
struct Rev<T>(pub T);

impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}

impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}

#[allow(unused_macros)]
macro_rules! debug {
    ($x: expr) => {
        println!("{}: {:?}", stringify!($x), $x)
    }
}

fn main() {
    let n: usize = util::get();
    let ab: Vec<(usize, usize)> = (0..n).map(|_| util::get2()).collect();

    println!("{}", ab.iter().max().map(|&(a, b)| a + b).unwrap());
}

Submission Info

Submission Time
Task B - Exactly N points
User hatoo
Language Rust (1.15.1)
Score 0
Code Size 2712 Byte
Status RE
Exec Time 9 ms
Memory 4352 KB

Judge Result

Set Name sample dataset1 dataset2
Score / Max Score 0 / 0 0 / 200 0 / 100
Status
RE × 3
RE × 13
RE × 24
Set Name Test Cases
sample sample-01.txt, sample-02.txt, sample-03.txt
dataset1 sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt
dataset2 sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, sample-01.txt, sample-02.txt, sample-03.txt
Case Name Status Exec Time Memory
01-01.txt RE 2 ms 4352 KB
01-02.txt RE 2 ms 4352 KB
01-03.txt RE 2 ms 4352 KB
01-04.txt RE 2 ms 4352 KB
01-05.txt RE 2 ms 4352 KB
01-06.txt RE 2 ms 4352 KB
01-07.txt RE 2 ms 4352 KB
01-08.txt RE 2 ms 4352 KB
01-09.txt RE 2 ms 4352 KB
01-10.txt RE 9 ms 4352 KB
02-01.txt RE 2 ms 4352 KB
02-02.txt RE 2 ms 4352 KB
02-03.txt RE 3 ms 4352 KB
02-04.txt RE 2 ms 4352 KB
02-05.txt RE 2 ms 4352 KB
02-06.txt RE 2 ms 4352 KB
02-07.txt RE 2 ms 4352 KB
02-08.txt RE 2 ms 4352 KB
sample-01.txt RE 2 ms 4352 KB
sample-02.txt RE 2 ms 4352 KB
sample-03.txt RE 2 ms 4352 KB