Task: | Vuodet |
Sender: | actually |
Submission time: | 2025-09-06 20:02:06 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
Compiler report
input/code.cpp: In function 'bool check_leet(int)': input/code.cpp:17:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 17 | for (int i = 0; i < sx.length(); i++) { | ~~^~~~~~~~~~~~~
Code
#include <iostream> #include <vector> #include <string> using namespace std; typedef long long ll; typedef long double ld; bool check_leet(int y) { int leet = 1337; int x = y * leet; string sx = to_string(x); string sy = to_string(y); int m = sy.length(); int j = 0; for (int i = 0; i < sx.length(); i++) { if (sx[i] == sy[j]) j++; if (j == m) break; } if (j == m) return true; return false; } void testCase() { int a, b; cin >> a >> b; vector<int> v; for (int i = a; i <= b; i++) { if (check_leet(i)) v.push_back(i); } int n = v.size(); cout << n << "\n"; for (int i = 0; i < n; i++) cout << v[i] << "\n"; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); testCase(); }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1600 2400 |
correct output |
---|
6 1625 2000 2025 2050 ... |
user output |
---|
6 1625 2000 2025 2050 ... |
Test 2
Verdict: ACCEPTED
input |
---|
1773 1773 |
correct output |
---|
0 |
user output |
---|
0 |
Test 3
Verdict: ACCEPTED
input |
---|
2025 2025 |
correct output |
---|
1 2025 |
user output |
---|
1 2025 |