結果

問題 No.1081 和の和
ユーザー ⁣
提出日時 2024-06-05 14:47:36
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 11,245 ms
コンパイル使用メモリ 404,268 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-05 14:47:49
合計ジャッジ時間 12,504 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::Read;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let v: Vec<u64> = s.split_whitespace().flat_map(str::parse).collect();
	let (mut a, mut r, n) = (0, 1, v[0] - 1);
	for i in 0..=n {
		a += r * v[1 + i as usize];
		r *= n - i;
		r /= i + 1;
	}
	println!("{}", a % 1000000007)
}
0