結果
| 問題 | No.365 ジェンガソート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-06 11:49:44 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 790 ms |
| コンパイル使用メモリ | 198,240 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-03 20:07:25 |
| 合計ジャッジ時間 | 1,796 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 41 |
コンパイルメッセージ
warning: unused imports: `BTreeSet`, `HashMap`, `HashSet`, and `VecDeque`
--> src/main.rs:1:24
|
1 | use std::collections::{BTreeSet, HashMap, HashSet, VecDeque};
| ^^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
warning: unused import: `proconio::marker::Chars`
--> src/main.rs:3:5
|
3 | use proconio::marker::Chars;
| ^^^^^^^^^^^^^^^^^^^^^^^
ソースコード
use std::collections::{BTreeSet, HashMap, HashSet, VecDeque};
use proconio::marker::Chars;
fn main() {
proconio::input! {
n: usize,
a: [usize; n],
}
let mut x = n;
let s = a
.iter()
.rev()
.filter(|&a| {
if *a == x {
x -= 1;
true
} else {
false
}
})
.count();
println!("{}", n - s);
}