Submission #2116908


Source Code Expand

#[allow(unused_imports)]
use std::io::{stdin, Read, StdinLock};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::{HashSet, HashMap, BinaryHeap, VecDeque};
#[allow(unused_imports)]
use std::vec::Vec;

#[allow(dead_code)]
const INF: i32 = 1000_000_000;
#[allow(dead_code)]
const INFLL: i64 = 1000_000_000_000_000_000;
#[allow(dead_code)]
const EPS: f64 = 1.0e-10;
#[allow(dead_code)]
const MOD: i32 = 1000_000_007;
#[allow(dead_code)]
const MODLL: i64 = 1000_000_007;

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner {cin: cin}
    }
    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
                    .skip_while(|c| c.is_whitespace())
                    .take_while(|c| !c.is_whitespace())
                    .collect::<String>();
        token.parse::<T>().ok()
    }
    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let n: usize = sc.read();
    let mut bottom: (usize, usize) = (0, 0);
    for _i in 0..n {
        let (a, b): (usize, usize) = (sc.read(), sc.read());
        bottom = max(bottom, (a, b));
    }
    let (br, bv) = bottom;
    println!("{}", br + bv);
}

Submission Info

Submission Time
Task B - Different Distribution
User Suibaka
Language Rust (1.15.1)
Score 200
Code Size 1555 Byte
Status AC
Exec Time 63 ms
Memory 4352 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 23
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt AC 62 ms 4352 KB
02.txt AC 62 ms 4352 KB
03.txt AC 63 ms 4352 KB
04.txt AC 62 ms 4352 KB
05.txt AC 63 ms 4352 KB
06.txt AC 62 ms 4352 KB
07.txt AC 62 ms 4352 KB
08.txt AC 62 ms 4352 KB
09.txt AC 62 ms 4352 KB
10.txt AC 62 ms 4352 KB
11.txt AC 38 ms 4352 KB
12.txt AC 52 ms 4352 KB
13.txt AC 52 ms 4352 KB
14.txt AC 63 ms 4352 KB
15.txt AC 2 ms 4352 KB
16.txt AC 2 ms 4352 KB
17.txt AC 2 ms 4352 KB
18.txt AC 2 ms 4352 KB
19.txt AC 2 ms 4352 KB
20.txt AC 2 ms 4352 KB
s1.txt AC 2 ms 4352 KB
s2.txt AC 2 ms 4352 KB
s3.txt AC 2 ms 4352 KB