結果

問題 No.481 1から10
ユーザー 💕💖💞💕💖💞
提出日時 2017-07-22 21:26:44
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 562 bytes
コンパイル時間 1,367 ms
コンパイル使用メモリ 173,280 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 15:57:50
合計ジャッジ時間 1,882 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

warning: unused variable: `v`
  --> main.rs:16:11
   |
16 |   for (k, v) in map.iter() {
   |           ^ help: if this is intentional, prefix it with an underscore: `_v`
   |
   = 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 mut map:HashMap<String, bool> = HashMap::new();
  let vec = "1 2 3 4 5 6 7 8 9 10".split(' ').collect::<Vec<&str>>();
  for x in vec.iter() {
    map.insert( x.to_string(), true );
  }
  let stdin         = io::stdin();
  let line          = stdin.lock().lines().next().unwrap().unwrap();
  let vec           = line.split(' ').collect::<Vec<&str>>();
  for x in vec.iter() {
    map.remove(&x.to_string());
  }
  for (k, v) in map.iter() {
    println!("{}", k);
  }
}
0