Submission details
Task:Vuodet
Sender:pupukani
Submission time:2025-09-05 18:23:51 +0300
Language:C++ (C++17)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.00 sdetails
#20.00 sdetails
#30.00 sdetails

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:

input
1600 2400

correct output
6
1625
2000
2025
2050
...

user output
(empty)

Test 2

Verdict:

input
1773 1773

correct output
0

user output
(empty)

Test 3

Verdict:

input
2025 2025

correct output
1
2025

user output
(empty)