結果

問題 No.3455 N-beatsu
コンテスト
ユーザー norioc
提出日時 2026-02-28 14:11:55
言語 Rust
(1.93.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 798 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,125 ms
コンパイル使用メモリ 216,408 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-02-28 14:11:58
合計ジャッジ時間 2,652 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `std::process::exit`
 --> src/main.rs:4:5
  |
4 | use std::process::exit;
  |     ^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

ソースコード

diff #
raw source code

#![allow(non_snake_case)]
#![allow(dead_code, unused_macros)]

use std::process::exit;
#[allow(unused_imports)]
use proconio::{input, marker::Usize1, marker::Chars};
#[allow(unused_imports)]
use itertools::Itertools;

macro_rules! d {
    ( $( $x:expr ),* $(,)? ) => {
        println!(
            concat!( $( stringify!($x), "={:?} " ),* ),
            $( $x ),*
        );
    };
}

fn yn(b: bool) -> &'static str {
    if b { "Yes" } else { "No" }
}

fn main() {
    input! {
        N: i64,
        Q: i64,
        X: [i64; Q],
    }

    let f = |x: i64| {
        if x % N == 0 { return true; }

        let s = x.to_string();
        if s.contains(&N.to_string()) { return true; }

        return false;
    };

    for x in X {
        let b = f(x);
        println!("{}", yn(b));
    }
}
0