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 codeforces/cf1985C/code.rs from Gax-c/VeriContest_Lite: direct link, hf CLI and curl.
- Browser
- Download file 499 Bytes
-
https://huggingface.co/datasets/Gax-c/VeriContest_Lite/resolve/main/codeforces/cf1985C/code.rs
- Command line
-
hf download hf://datasets/Gax-c/VeriContest_Lite/codeforces/cf1985C/code.rs
-
curl -L -o code.rs https://huggingface.co/datasets/Gax-c/VeriContest_Lite/resolve/main/codeforces/cf1985C/code.rs
499 Bytes
| impl Solution { | |
| pub fn count_good_prefixes_fn(a: Vec<u64>) -> usize { | |
| let mut sum: u64 = 0; | |
| let mut max_val: u64 = 0; | |
| let mut count: usize = 0; | |
| let mut i: usize = 0; | |
| while i < a.len() { | |
| let ai = a[i]; | |
| sum = sum + ai; | |
| if ai > max_val { | |
| max_val = ai; | |
| } | |
| if 2 * max_val == sum { | |
| count = count + 1; | |
| } | |
| i = i + 1; | |
| } | |
| count | |
| } | |
| } | |