結果
問題 | No.314 ケンケンパ |
ユーザー |
![]() |
提出日時 | 2022-12-05 20:10:59 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 325 bytes |
コンパイル時間 | 13,059 ms |
コンパイル使用メモリ | 377,968 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 17:30:07 |
合計ジャッジ時間 | 13,045 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
const DIVISOR: u64 = 10u64.pow(9) + 7;fn main() {let mut n = String::new();std::io::stdin().read_line(&mut n).ok();let n: u64 = n.trim().parse().unwrap();let mut c = (1, 0, 0);for _ in 0..n {c = ((c.1 + c.2) % DIVISOR, c.0, c.1);}println!("{}", (c.0 + c.1 + c.2) % DIVISOR);}