結果
| 問題 |
No.480 合計
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-12 18:48:56 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 1,219 bytes |
| コンパイル時間 | 14,461 ms |
| コンパイル使用メモリ | 378,440 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 10:00:27 |
| 合計ジャッジ時間 | 13,737 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
macro_rules! scan {
($t:ty) => {
{
let mut line: String = String::new();
std::io::stdin().read_line(&mut line).unwrap();
line.trim().parse::<$t>().unwrap()
}
};
($t:ty;;) => {
{
let mut line: String = String::new();
std::io::stdin().read_line(&mut line).unwrap();
line.split_whitespace()
.map(|t| t.parse::<$t>().unwrap())
.collect::<Vec<_>>()
}
};
($t:ty; $n:expr) => {
(0..$n).map(|_|
scan!($t)
).collect::<Vec<_>>()
};
($t:ty;;$n:expr) => {
(0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
};
($($t:ty),*; $n:expr) => {
(0..$n).map(|_|
scan!($($t),*)
).collect::<Vec<_>>()
};
($($t:ty),*) => {
{
let mut line: String = String::new();
std::io::stdin().read_line(&mut line).unwrap();
let mut iter = line.split_whitespace();
(
$(iter.next().unwrap().parse::<$t>().unwrap(),)*
)
}
};
}
fn main() {
let n = scan!(usize);
println!("{}", n * (n + 1) / 2)
}