Datasets:
Tasks:
Text Generation
Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
ArXiv:
Tags:
competitive-programming
code-generation
specification-generation
proof-generation
verification
rust
License:
Download leetcode/lc1411/code.rs from Gax-c/VeriContest_Lite: direct link, hf CLI and curl.
- Browser
- Download file 458 Bytes
-
https://huggingface.co/datasets/Gax-c/VeriContest_Lite/resolve/main/leetcode/lc1411/code.rs
- Command line
-
hf download hf://datasets/Gax-c/VeriContest_Lite/leetcode/lc1411/code.rs
-
curl -L -o code.rs https://huggingface.co/datasets/Gax-c/VeriContest_Lite/resolve/main/leetcode/lc1411/code.rs
458 Bytes
| impl Solution { | |
| pub fn num_of_ways(n: i32) -> i32 { | |
| let modv: i64 = 1_000_000_007; | |
| let mut a121: i64 = 6; | |
| let mut a123: i64 = 6; | |
| let mut i: i32 = 1; | |
| while i < n { | |
| let new_a121 = (3 * a121 + 2 * a123) % modv; | |
| let new_a123 = (2 * a121 + 2 * a123) % modv; | |
| a121 = new_a121; | |
| a123 = new_a123; | |
| i = i + 1; | |
| } | |
| ((a121 + a123) % modv) as i32 | |
| } | |
| } | |