結果

問題 No.374 コイン
コンテスト
ユーザー reicalgrst
提出日時 2026-10-23 00:22:55
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 1,000 ms
+ 453µs
コード長 884 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 990 ms
コンパイル使用メモリ 180,700 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-10-23 00:24:27
合計ジャッジ時間 4,125 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#![allow(non_snake_case)]
use proconio::*;

// https://maguro.dev/blog/debug-macro/
#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),* $(,)*) => {
        #[cfg(debug_assertions)]
        eprintln!(concat!($("| ", stringify!($a), " = {:?} "),*, "|"), $(&$a),*);
    };
}

fn main() {
    std::thread::Builder::new()
        .stack_size(256 * 1024 * 1024)
        .spawn(solve)
        .unwrap()
        .join()
        .unwrap();
}

// 真ん中に置いてそっから周辺に置いていくみたいに操作すると良い?
// 6 の倍数ずつ置ける

fn solve() {
    input! {
        a: usize, b: usize,
    }

    let mut now = 0;
    if b <= a {
        now += 1;
        let mut i = 1;

        while 2 * i * b <= a {
            now += 6 * i;
            i += 1;
        }
    }

    let res = if now % 2 == 0 { "K" } else { "S" };
    println!("{res}");
}
0