結果

問題 No.1491 銀将
ユーザー fukafukatanifukafukatani
提出日時 2021-04-30 21:52:40
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 682 bytes
コンパイル時間 17,949 ms
コンパイル使用メモリ 378,208 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 01:15:44
合計ジャッジ時間 18,416 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;
use std::ops::Bound::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let k = read::<i64>();
    let mut ans = (2 * k + 1) * k + (2 * k - 1) * (k - 1);
    ans += k;
    ans += k + 1;
    println!("{}", ans);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
0