Last active
January 28, 2020 01:19
-
-
Save Riey/41ebf43b7992b7da0c337adb5a32a4e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::{self, BufRead}; | |
use std::iter; | |
use itertools::Itertools; | |
fn get_line() -> String { | |
let mut buf = String::with_capacity(64); | |
io::stdin().lock().read_line(&mut buf).unwrap(); | |
buf | |
} | |
fn read_tuple() -> (i32, i32) { | |
get_line() | |
.split(' ') | |
.map(|s| s.parse().unwrap()) | |
.next_tuple() | |
.unwrap() | |
} | |
fn main() { | |
let n: usize = get_line().parse().unwrap(); | |
let f: Vec<(i32, i32)> = iter::repeat_with(read_tuple) | |
.take(n) | |
.collect(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment