Task: | Vuodet |
Sender: | jubidubi |
Submission time: | 2025-09-06 18:21:23 +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 |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:20:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 20 | while (yi < y.size() && si < s.size()) { | ~~~^~~~~~~~~~ input/code.cpp:20:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 20 | while (yi < y.size() && si < s.size()) { | ~~~^~~~~~~~~~ input/code.cpp:26:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 26 | if (yi == y.size()) res.push_back(i); | ~~~^~~~~~~~~~~
Code
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios_base::sync_with_stdio(false); cin.tie(0); ll a, b; cin >> a >> b; vector<int> res; for (ll i = a; i <= b; ++i) { ll x = i * 1337; string s = to_string(x); string y = to_string(i); int si = 0; int yi = 0; while (yi < y.size() && si < s.size()) { if (s[si] == y[yi]) { ++si; ++yi; } else ++si; } if (yi == y.size()) res.push_back(i); } cout << res.size() << endl; for (int x : res) cout << x << endl; }
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 |