結果
問題 | No.892 タピオカ |
ユーザー |
![]() |
提出日時 | 2019-09-27 21:25:23 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 1,835 bytes |
コンパイル時間 | 13,288 ms |
コンパイル使用メモリ | 391,784 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 20:42:48 |
合計ジャッジ時間 | 12,640 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
use std::io::{stdin, Read, StdinLock};use std::str::FromStr;use std::iter::FromIterator;fn main() {let cin = stdin();let mut scan = Scanner::new(cin.lock());let ab = arr(3, |_| (scan.read::<i64>(), scan.read::<i64>()));println!("{}", if ab.iter().filter(|&&x| x.0 % 2 != 0).count() % 2 == 0 {":-)"} else {":-("});}// region template#[allow(dead_code)]fn iu(i: i64) -> usize { i as usize }#[allow(dead_code)]fn ui(i: usize) -> i64 { i as i64 }#[allow(dead_code, deprecated)]fn join<T: std::fmt::Display>(slice: &[T], sep: &str) -> String {let strings = slice.iter().map(|t| format!("{}", t)).collect::<Vec<_>>();strings.connect(sep)}#[allow(dead_code)]fn arr<'a, S, T>(n: usize, mut f: S) -> Vec<T> where S: FnMut(usize) -> T + 'a {(0..n).map(|i| f(i)).collect::<Vec<T>>()}#[allow(dead_code)]fn alt<S, T>(v: Vec<S>) -> T where T: FromIterator<S> {v.into_iter().collect::<T>()}#[allow(dead_code)]fn dup<S, T>(v: &[S]) -> T where T: FromIterator<S>, S: Clone {v.iter().cloned().collect::<T>()}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 readn<T: FromStr>(&mut self, n: usize) -> Vec<T> {(0..n).map(|_| self.read::<T>()).collect()}fn chars(&mut self) -> Vec<char> {self.read::<String>().chars().collect()}}// endregion