| Task: | Vuodet |
| Sender: | Guuber3 |
| Submission time: | 2025-09-06 10:52:58 +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 is_leet(int)':
input/code.cpp:12:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
12 | for (int i = 0; i < s.size(); i++) {
| ~~^~~~~~~~~~
input/code.cpp:14:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
14 | if (match_i == match.size()) return true;
| ~~~~~~~~^~~~~~~~~~~~~~~Code
#include<iostream>
#include<string>
#include<vector>
using namespace std;
bool is_leet(int x) {
string s = to_string(x * 1337);
string match = to_string(x);
int match_i = 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] == match[match_i]) match_i++;
if (match_i == match.size()) return true;
}
return false;
}
int main() {
int n,m;
cin >> n >> m;
vector<int> results;
for (int i = n; i <= m; i++) {
if (is_leet(i)) results.push_back(i);
}
cout << results.size() << "\n";
for (auto u : results) cout << u << "\n";
}
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 |
