Download uva_cpp_clean/10049/10049-19.cpp from slayone/uva_spoj_raw: direct link, hf CLI and curl.
- Browser
- Download file 563 Bytes
-
https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10049/10049-19.cpp
- Command line
-
hf download hf://datasets/slayone/uva_spoj_raw/uva_cpp_clean/10049/10049-19.cpp
-
curl -L -o 10049-19.cpp https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10049/10049-19.cpp
563 Bytes
| using namespace std; | |
| int main() { | |
| vector<int> v; | |
| int last = 5; | |
| v.push_back(0); | |
| v.push_back(1); | |
| v.push_back(3); | |
| v.push_back(5); | |
| for (int i = 4; true; i++) { | |
| int res = lower_bound(v.begin(), v.end(), i) - v.begin(); | |
| last += res; | |
| v.push_back(last); | |
| if (last > 2000000000) break; | |
| } | |
| int n; | |
| while (cin >> n && n != 0) { | |
| int res = lower_bound(v.begin(), v.end(), n) - v.begin(); | |
| printf("%d\n", res); | |
| } | |
| return 0; | |
| } | |