Submission #3450294
Source Code Expand
use scanner::Scanner; fn main() { let mut sc = Scanner::new(); let mut colors:Vec<i32> = (0..3).map(|_| sc.read()).collect(); colors.sort(); colors.dedup(); println!("{}", colors.len()) } mod scanner { pub struct Scanner<'a> { s: String, words: ::std::str::SplitWhitespace<'a>, } impl<'a> Scanner<'a> { pub fn new() -> Scanner<'a> { let s = String::new(); let words = unsafe { ::std::mem::transmute(s.split_whitespace()) }; Scanner { s: s, words: words } } pub fn read<T: ::std::str::FromStr>(&mut self) -> T { match self.words.next() { Some(x) => x.parse().ok().unwrap(), None => { self.load(); self.read() } } } fn load(&mut self) { self.s.clear(); ::std::io::stdin().read_line(&mut self.s).unwrap(); self.words = unsafe { ::std::mem::transmute(self.s.split_whitespace()) }; } } }
Submission Info
Submission Time | |
---|---|
Task | A - AtCoDeer and Paint Cans |
User | relieved_face |
Language | Rust (1.15.1) |
Score | 100 |
Code Size | 1116 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 4352 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt |
All | 0_000.txt, 0_001.txt, 1_002.txt, 1_003.txt, 1_004.txt, 1_005.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 2 ms | 4352 KB |
0_001.txt | AC | 2 ms | 4352 KB |
1_002.txt | AC | 2 ms | 4352 KB |
1_003.txt | AC | 2 ms | 4352 KB |
1_004.txt | AC | 2 ms | 4352 KB |
1_005.txt | AC | 2 ms | 4352 KB |