Submission details
Task:Vuodet
Sender:vgtcross
Submission time:2025-09-05 18:03:48 +0300
Language:C++ (C++20)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#2ACCEPTED0.00 sdetails
#3ACCEPTED0.00 sdetails

Compiler report

input/code.cpp: In function 'void solve()':
input/code.cpp:47:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   47 |             if (i < s.size() && s[i] == c) ++i;
      |                 ~~^~~~~~~~~~
input/code.cpp:49:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |         if (i == s.size()) ans.push_back(x);
      |             ~~^~~~~~~~~~~

Code

#include <bits/stdc++.h>

#define MODE 1

#if MODE
#define debug(x) cout << #x << ": " << (x) << endl
#define log(x) cout << (x) << endl
#define test(x) x
#else
#define debug(x)
#define log(x)
#define test(x)
#endif

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
#define X real()
#define Y imag()

using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using P = complex<ll>;

template<typename S, typename T = S> void chmin(S &s, T t) {s = s < t ? s : t;}
template<typename S, typename T = S> void chmax(S &s, T t) {s = s > t ? s : t;}

const ll M = 1000000007; // 998244353

void solve() {
    int a, b;
    cin >> a >> b;
    
    vector<int> ans;
    
    for (int x = a; x <= b; ++x) {
        string s = to_string(x);
        string t = to_string(1337*x);
        int i = 0;
        for (char c : t) {
            if (i < s.size() && s[i] == c) ++i;
        }
        if (i == s.size()) ans.push_back(x);
    }
    
    cout << ans.size() << '\n';
    for (int x : ans) cout << x << '\n';
}

int main() {
    cin.tie(0) -> sync_with_stdio(0);
    
    int t = 1;
    if (t == 0) cin >> t;
    while (t--) solve();
    
    return 0;
}

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