結果
| 問題 |
No.365 ジェンガソート
|
| コンテスト | |
| ユーザー |
neko_the_shadow
|
| 提出日時 | 2024-02-14 16:24:03 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 470 bytes |
| コンパイル時間 | 11,144 ms |
| コンパイル使用メモリ | 404,940 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-09-28 18:55:37 |
| 合計ジャッジ時間 | 13,374 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 25 |
コンパイルメッセージ
warning: unused variable: `N` --> src/main.rs:4:9 | 4 | let N = input().parse::<usize>(); | ^ help: if this is intentional, prefix it with an underscore: `_N` | = note: `#[warn(unused_variables)]` on by default warning: variable `N` should have a snake case name --> src/main.rs:4:9 | 4 | let N = input().parse::<usize>(); | ^ help: convert the identifier to snake case: `n` | = note: `#[warn(non_snake_case)]` on by default warning: variable `A` should have a snake case name --> src/main.rs:5:9 | 5 | let A = input().split_whitespace().map(|t| t.parse::<usize>().unwrap()).collect::<Vec<_>>(); | ^ help: convert the identifier to snake case: `a`
ソースコード
use std::{cmp::max, io::stdin};
fn main() {
let N = input().parse::<usize>();
let A = input().split_whitespace().map(|t| t.parse::<usize>().unwrap()).collect::<Vec<_>>();
let mut mx = 0;
let mut c = 0;
for a in A {
if a < mx {
c += 1;
}
mx = max(mx, a);
}
println!("{}", c);
}
fn input() -> String {
let mut buf = String::new();
stdin().read_line(&mut buf).unwrap();
buf.trim().to_string()
}
neko_the_shadow