結果

問題 No.480 合計
ユーザー 💕💖💞
提出日時 2017-07-22 21:43:04
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 13,252 ms
コンパイル使用メモリ 383,148 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 09:32:40
合計ジャッジ時間 14,362 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused imports: `HashMap`, `LinkedList`
 --> src/main.rs:2:24
  |
2 | use std::collections::{HashMap, LinkedList};
  |                        ^^^^^^^  ^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

ソースコード

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 ac     = (1..m+1).fold(0, |acc, x| acc + x);
  println!("{}", ac);
}
0