| Task: | Vuodet |
| Sender: | Gomhog |
| Submission time: | 2025-09-05 21:26:09 +0300 |
| Language: | C++ (C++11) |
| 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 |
Code
#include <bits/stdc++.h>
#define F first
#define S second
#define X real()
#define Y imag()
using namespace std;
typedef long long ll;
typedef long double ld;
bool isLeet(int a) {
int b = 1337*a;
vector<int> numA, numB;
while (a) {
numA.push_back(a%10);
a/=10;
}
while (b) {
numB.push_back(b%10);
b/=10;
}
int pa= numA.size()-1;
for (int pb = numB.size()-1; pb >= 0; pb--) {
if (numB[pb] == numA[pa]) pa--;
if (pa == -1) return true;
}
return false;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int a, b;
cin>>a>>b;
vector<int> leets;
for (int i=a; i<=b; i++) {
if (isLeet(i)) leets.push_back(i);
}
cout<<leets.size()<<"\n";
for (int i : leets) cout<<i<<"\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 |
