結果

問題 No.192 合成数
コンテスト
ユーザー ああ
提出日時 2026-10-12 18:18:36
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 2,000 ms
+ 880µs
コード長 246 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 441 ms
コンパイル使用メモリ 184,784 KB
実行使用メモリ 9,908 KB
最終ジャッジ日時 2026-10-12 18:18:54
合計ジャッジ時間 2,899 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unnecessary parentheses around `for` iterator expression
 --> src/main.rs:8:14
  |
8 |     for i in (n-100..n+101){
  |              ^            ^
  |
  = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default
help: remove these parentheses
  |
8 -     for i in (n-100..n+101){
8 +     for i in n-100..n+101 {
  |

warning: unnecessary parentheses around `for` iterator expression
 --> src/main.rs:9:18
  |
9 |         for j in (2..i){
  |                  ^    ^
  |
help: remove these parentheses
  |
9 -         for j in (2..i){
9 +         for j in 2..i {
  |

ソースコード

diff #
raw source code

use proconio::input;

fn main(){
    input!{
        n:usize,
    }
    let mut ans=0;
    for i in (n-100..n+101){
        for j in (2..i){
            if i%j==0{
                ans=i;break;
            }
        }
    }
    print!("{}",ans);
}
0