結果

問題 No.1506 Unbalanced Pocky Game
ユーザー Rheo TommyRheo Tommy
提出日時 2021-05-14 22:13:20
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 3,412 bytes
コンパイル時間 764 ms
コンパイル使用メモリ 170,788 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 00:32:02
合計ジャッジ時間 2,492 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,820 KB
testcase_02 AC 1 ms
6,816 KB
testcase_03 WA -
testcase_04 AC 3 ms
6,944 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
6,940 KB
testcase_09 WA -
testcase_10 AC 3 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 WA -
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 1 ms
6,940 KB
testcase_19 AC 1 ms
6,940 KB
testcase_20 AC 4 ms
6,944 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 1 ms
6,944 KB
testcase_25 AC 5 ms
6,940 KB
testcase_26 AC 7 ms
6,940 KB
testcase_27 AC 7 ms
6,944 KB
testcase_28 WA -
testcase_29 AC 7 ms
6,944 KB
testcase_30 AC 6 ms
6,944 KB
testcase_31 WA -
testcase_32 AC 7 ms
6,940 KB
testcase_33 AC 7 ms
6,940 KB
testcase_34 AC 6 ms
6,944 KB
testcase_35 AC 7 ms
6,944 KB
testcase_36 AC 1 ms
6,940 KB
testcase_37 AC 1 ms
6,944 KB
testcase_38 AC 1 ms
6,940 KB
testcase_39 AC 1 ms
6,944 KB
testcase_40 AC 1 ms
6,940 KB
testcase_41 AC 1 ms
6,940 KB
testcase_42 AC 1 ms
6,944 KB
testcase_43 AC 0 ms
6,944 KB
testcase_44 AC 1 ms
6,944 KB
testcase_45 AC 1 ms
6,944 KB
testcase_46 AC 3 ms
6,940 KB
testcase_47 AC 1 ms
6,940 KB
testcase_48 AC 2 ms
6,944 KB
testcase_49 AC 4 ms
6,944 KB
testcase_50 AC 3 ms
6,940 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 4 ms
6,944 KB
testcase_54 AC 2 ms
6,940 KB
testcase_55 AC 1 ms
6,944 KB
testcase_56 AC 2 ms
6,944 KB
testcase_57 AC 3 ms
6,940 KB
testcase_58 AC 2 ms
6,940 KB
testcase_59 WA -
testcase_60 AC 2 ms
6,944 KB
testcase_61 WA -
testcase_62 AC 2 ms
6,944 KB
testcase_63 AC 2 ms
6,944 KB
testcase_64 AC 3 ms
6,940 KB
testcase_65 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

// # ファイル構成
// - use 宣言
// - lib モジュール
// - main 関数
// - basic モジュール
//
// 常に使うテンプレートライブラリは basic モジュール内にあります。
// 問題に応じて使うライブラリ lib モジュール内にコピペしています。
// ライブラリのコードはこちら → https://github.com/RheoTommy/at_coder
// Twitter はこちら → https://twitter.com/RheoTommy

use std::collections::*;
use std::io::{stdout, BufWriter, Write};

use crate::basic::*;
use crate::lib::*;

pub mod lib {}

fn main() {
    let mut io = IO::new();
    let n = io.next_usize();
    let a = io.next_vec::<usize>(n);
    let ans = if a[n - 1] != 1 { "Alice" } else { "Bob" };
    io.println(ans);
}

pub mod basic {
    pub const U_INF: u64 = (1 << 60) + (1 << 30);
    pub const I_INF: i64 = (1 << 60) + (1 << 30);

    pub struct IO {
        iter: std::str::SplitAsciiWhitespace<'static>,
        buf: std::io::BufWriter<std::io::StdoutLock<'static>>,
    }

    impl Default for IO {
        fn default() -> Self {
            Self::new()
        }
    }

    impl IO {
        pub fn new() -> Self {
            use std::io::*;
            let mut input = String::new();
            std::io::stdin().read_to_string(&mut input).unwrap();
            let input = Box::leak(input.into_boxed_str());
            let out = Box::new(stdout());
            IO {
                iter: input.split_ascii_whitespace(),
                buf: BufWriter::new(Box::leak(out).lock()),
            }
        }
        pub fn next_str(&mut self) -> &str {
            self.iter.next().unwrap()
        }
        pub fn read<T: std::str::FromStr>(&mut self) -> T
            where
                <T as std::str::FromStr>::Err: std::fmt::Debug,
        {
            self.iter.next().unwrap().parse().unwrap()
        }
        pub fn next_usize(&mut self) -> usize {
            self.read()
        }
        pub fn next_uint(&mut self) -> u64 {
            self.read()
        }
        pub fn next_int(&mut self) -> i64 {
            self.read()
        }
        pub fn next_float(&mut self) -> f64 {
            self.read()
        }
        pub fn next_chars(&mut self) -> std::str::Chars {
            self.next_str().chars()
        }
        pub fn next_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T>
            where
                <T as std::str::FromStr>::Err: std::fmt::Debug,
        {
            (0..n).map(|_| self.read()).collect::<Vec<_>>()
        }
        pub fn print<T: std::fmt::Display>(&mut self, t: T) {
            use std::io::Write;
            write!(self.buf, "{}", t).unwrap();
        }
        pub fn println<T: std::fmt::Display>(&mut self, t: T) {
            self.print(t);
            self.print("\n");
        }
        pub fn print_iter<T: std::fmt::Display, I: Iterator<Item=T>>(
            &mut self,
            mut iter: I,
            sep: &str,
        ) {
            if let Some(v) = iter.next() {
                self.print(v);
                for vi in iter {
                    self.print(sep);
                    self.print(vi);
                }
            }
            self.print("\n");
        }
        pub fn flush(&mut self) {
            use std::io::Write;
            self.buf.flush().unwrap();
        }
    }
}
0