Task: | Vuodet |
Sender: | pupukani |
Submission time: | 2025-09-05 18:23:51 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
test | verdict | time | |
---|---|---|---|
#1 | RUNTIME ERROR | 0.00 s | details |
#2 | RUNTIME ERROR | 0.00 s | details |
#3 | RUNTIME ERROR | 0.00 s | details |
Compiler report
input/code.cpp: In function 'int main(int, char**)': input/code.cpp:23:13: warning: unused variable 'k' [-Wunused-variable] 23 | int k; | ^
Code
#include <iostream> #include <string> #include <cassert> #include <vector> bool has_digits(std::string year, const std::string leetyear) { int i = 0; for (const char c : leetyear) if (year[i] == c) i++; return i == 4; } int main(int argc, char **argv) { if (argc != 3) return 1; int a = atoi(argv[1]); int b = atoi(argv[2]); int k; assert(has_digits("2025", "2707425")); std::vector<int> leetvuodet; for (int i = a; i < b; ++i) { if (has_digits(std::to_string(i), std::to_string(i * 1337))) leetvuodet.push_back(i); } std::cout << leetvuodet.size() << std::endl; for (int v : leetvuodet) { std::cout << v << std::endl; } }
Test details
Test 1
Verdict: RUNTIME ERROR
input |
---|
1600 2400 |
correct output |
---|
6 1625 2000 2025 2050 ... |
user output |
---|
(empty) |
Test 2
Verdict: RUNTIME ERROR
input |
---|
1773 1773 |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 3
Verdict: RUNTIME ERROR
input |
---|
2025 2025 |
correct output |
---|
1 2025 |
user output |
---|
(empty) |