結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー 💕💖💞💕💖💞
提出日時 2017-07-22 14:25:39
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 1,910 ms
コンパイル使用メモリ 174,184 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 15:34:42
合計ジャッジ時間 1,769 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 4 ms
5,376 KB
testcase_02 AC 0 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 4 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
5,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 3 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 3 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 3 ms
5,376 KB
testcase_19 AC 3 ms
5,376 KB
testcase_20 AC 4 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 4 ms
5,376 KB
testcase_24 AC 4 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `LinkedList`
 --> main.rs:3:33
  |
3 | use std::collections::{HashMap, LinkedList};
  |                                 ^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused variable: `m`
 --> main.rs:8:7
  |
8 |   let m = line.parse::<i32>().unwrap();
  |       ^ help: if this is intentional, prefix it with an underscore: `_m`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: 2 warnings emitted

ソースコード

diff #

use std::io::{self, BufRead};
use std::collections::{HashMap, LinkedList};

fn main() {
  let stdin = io::stdin();
  let line = stdin.lock().lines().next().unwrap().unwrap();
  let m = line.parse::<i32>().unwrap();
 
  let line = stdin.lock().lines().next().unwrap().unwrap();
  let iter = line.split_whitespace();
  let mut v:Vec<i32> = Vec::new();

  for e in iter { 
    let b = (*e).parse::<i32>().unwrap();
    v.push( b );
  }
  
  let mut ii:HashMap<i32, i32> = HashMap::new();
  for i in v {
    *ii.entry(i).or_insert(0) += 10;
  }
  let mut tmp1:i32 = 0;
  let mut tmp2:i32 = 0;
  for (k, v) in ii.iter() {
    if tmp1 < *v {
      tmp2 = *k;
      tmp1 = *v;
    }
  }
  println!("{}", tmp2);
}
0