結果
| 問題 |
No.480 合計
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-06 13:31:29 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 546 bytes |
| コンパイル時間 | 12,014 ms |
| コンパイル使用メモリ | 405,068 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-23 12:21:34 |
| 合計ジャッジ時間 | 12,872 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
use std::io::{self, BufRead, BufReader, BufWriter, Write};
fn main() {
let stdin = io::stdin();
let mut stdin = BufReader::new(stdin.lock());
let stdout = io::stdout();
let mut stdout = BufWriter::new(stdout.lock());
run(&mut stdin, &mut stdout);
}
fn run<R, W>(input: &mut R, output: &mut W)
where
R: BufRead,
W: Write,
{
let mut n = String::new();
input.read_line(&mut n).unwrap();
let n: u32 = n.trim().parse().unwrap();
let sum: u32 = (1..=n).sum();
writeln!(output, "{}", sum).unwrap();
}