Submission #4070312
Source Code Expand
macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); let mut next = || { iter.next().unwrap() }; input_inner!{next, $($r)*} }; ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes .by_ref() .map(|r|r.unwrap() as char) .skip_while(|c|c.is_whitespace()) .take_while(|c|!c.is_whitespace()) .collect() }; input_inner!{next, $($r)*} }; } macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} }; } macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }; ($next:expr, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; } fn main() { input!{ s: [chars; 3], } println!("{}", if s[0].last() == s[1].first() && s[1].last() == s[2].first() {"YES"} else {"NO"}); }
Submission Info
Submission Time | |
---|---|
Task | A - Shiritori |
User | dbftdiyoeywga |
Language | Rust (1.15.1) |
Score | 100 |
Code Size | 1539 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 | example0, example1, example2, example3 |
All | ansno0, ansno1, ansno2, ansno3, ansno4, ansyes0, ansyes1, ansyes2, ansyes3, ansyes4, example0, example1, example2, example3 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
ansno0 | AC | 2 ms | 4352 KB |
ansno1 | AC | 2 ms | 4352 KB |
ansno2 | AC | 2 ms | 4352 KB |
ansno3 | AC | 2 ms | 4352 KB |
ansno4 | AC | 2 ms | 4352 KB |
ansyes0 | AC | 2 ms | 4352 KB |
ansyes1 | AC | 2 ms | 4352 KB |
ansyes2 | AC | 2 ms | 4352 KB |
ansyes3 | AC | 2 ms | 4352 KB |
ansyes4 | AC | 2 ms | 4352 KB |
example0 | AC | 2 ms | 4352 KB |
example1 | AC | 2 ms | 4352 KB |
example2 | AC | 2 ms | 4352 KB |
example3 | AC | 2 ms | 4352 KB |