結果

問題 No.365 ジェンガソート
ユーザー megumishmegumish
提出日時 2016-04-29 22:30:42
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 1,129 bytes
コンパイル時間 1,715 ms
コンパイル使用メモリ 172,908 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 05:34:53
合計ジャッジ時間 3,028 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 0 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 0 ms
6,944 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 1 ms
6,944 KB
testcase_19 AC 5 ms
6,940 KB
testcase_20 AC 3 ms
6,940 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 5 ms
6,940 KB
testcase_37 AC 6 ms
6,944 KB
testcase_38 WA -
testcase_39 AC 6 ms
6,940 KB
testcase_40 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `std::str::Chars`
 --> main.rs:3:5
  |
3 | use std::str::Chars;
  |     ^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `std::u8`
 --> main.rs:5:5
  |
5 | use std::u8;
  |     ^^^^^^^

warning: unused import: `std::ascii::AsciiExt`
 --> main.rs:6:5
  |
6 | use std::ascii::AsciiExt;
  |     ^^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::collections::HashMap`
 --> main.rs:7:5
  |
7 | use std::collections::HashMap;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::collections::HashSet`
 --> main.rs:8:5
  |
8 | use std::collections::HashSet;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::collections::BTreeMap`
 --> main.rs:9:5
  |
9 | use std::collections::BTreeMap;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::collections::BTreeSet`
  --> main.rs:10:5
   |
10 | use std::collections::BTreeSet;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::collections::VecDeque`
  --> main.rs:11:5
   |
11 | use std::collections::VecDeque;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated trait `std::ascii::AsciiExt`: use inherent methods instead
 --> main.rs:6:17
  |
6 | use std::ascii::AsciiExt;
  |                 ^^^^^^^^
  |
  = note: `#[warn(deprecated)]` on by default

warning: unused import: `std::io::prelude`
  --> main.rs:12:5
   |
12 | use std::io::prelude::*;
   |     ^^^^^^^^^^^^^^^^

warning: unused variable: `n`
  --> main.rs:16:9
   |
16 |     let n = next_int();
   |         ^ help: if this is intentional, prefix it with an underscore: `_n`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: 11 warnings emitted

ソースコード

diff #

use std::io;
use std::str::FromStr;
use std::str::Chars;
use std::i32;
use std::u8;
use std::ascii::AsciiExt;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::collections::VecDeque;
use std::io::prelude::*;


fn main() {
    let n = next_int();
    let a = next_ints();
    let mut max = i32::MIN as i64;
    let mut ans = 0;
    for i in a {
        if i > max {
            max = i;
        }
        else {
            ans += 1;
        }
    }
    println!("{}",ans);
}

#[allow(dead_code)]
fn next_string() -> String {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    input
}

#[allow(dead_code)]
fn next_strings() -> Vec<String> {
    let input = next_string();
    input.split_whitespace().map(|x| x.parse().unwrap()).collect()
}

#[allow(dead_code)]
fn next_int() -> i64 {
    let input = next_string();
    i64::from_str(input.trim()).unwrap()
}

#[allow(dead_code)]
fn next_ints() -> Vec<i64> {
    let input = next_string();
    input.split_whitespace().map(|x| x.parse().unwrap()).collect()
}
0