結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
💕💖💞
|
| 提出日時 | 2017-07-22 14:25:39 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 706 bytes |
| コンパイル時間 | 13,947 ms |
| コンパイル使用メモリ | 379,756 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 09:36:13 |
| 合計ジャッジ時間 | 15,231 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 21 WA * 1 |
コンパイルメッセージ
warning: unused import: `LinkedList`
--> src/main.rs:3:33
|
3 | use std::collections::{HashMap, LinkedList};
| ^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused variable: `m`
--> src/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
ソースコード
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);
}
💕💖💞