| Task: | Vuodet |
| Sender: | mangolassi |
| Submission time: | 2025-09-07 11:52:16 +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:21:37: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
21 | if (matches < xstr.size() && c == xstr[matches]) ++matches;
| ~~~~~~~~^~~~~~~~~~~~~
input/code.cpp:23:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
23 | if (matches == xstr.size()) res.push_back(x);
| ~~~~~~~~^~~~~~~~~~~~~~Code
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int a, b;
cin >> a >> b;
vector<int> res;
for (int x = a; x <= b; ++x) {
int y = x * 1337;
string ystr = to_string(y);
string xstr = to_string(x);
int matches = 0;
for (auto c : ystr) {
if (matches < xstr.size() && c == xstr[matches]) ++matches;
}
if (matches == xstr.size()) res.push_back(x);
}
cout << res.size() << '\n';
for (auto v : res) cout << v << '\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 |
