結果
| 問題 | No.1986 Yummy |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-15 01:25:38 |
| 言語 | Rust (1.99.0 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 0 ms / 2,000 ms |
| + 995µs | |
| コード長 | 272 bytes |
| 記録 | |
| コンパイル時間 | 546 ms |
| コンパイル使用メモリ | 176,392 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-15 01:25:43 |
| 合計ジャッジ時間 | 3,001 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
コンパイルメッセージ
warning: unused import: `std::collections::HashMap` --> src/main.rs:2:5 | 2 | use std::collections::HashMap; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default warning: unused import: `std::collections::BTreeSet` --> src/main.rs:3:5 | 3 | use std::collections::BTreeSet; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused import: `std::ops::ControlFlow::Break` --> src/main.rs:4:5 | 4 | use std::ops::ControlFlow::Break; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: value assigned to `ans` is never read --> src/main.rs:9:17 | 9 | let mut ans=0; | ^ this value is reassigned later and never used ... 13 | ans=n/2; | ------- `ans` is overwritten here before the previous value is read | = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default
ソースコード
use proconio::input;
use std::collections::HashMap;
use std::collections::BTreeSet;
use std::ops::ControlFlow::Break;
fn main(){
input!{
n:usize,
}
let mut ans=0;
if n%2==1{
ans=1;
} else {
ans=n/2;
}
print!("{}",ans);
}