結果
| 問題 | No.365 ジェンガソート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-06 11:49:44 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 3 ms / 2,000 ms |
| + 884µs | |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 537 ms |
| コンパイル使用メモリ | 186,780 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-24 21:17:24 |
| 合計ジャッジ時間 | 3,348 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_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);
}