This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll a,b; cin >> a >> b;
ll cur = a;
while(cur <= b){
int dig = 1; ll exp = 10;
for(int i = 1;i<=18;++i){
if(cur >= exp){
++dig;
exp *= 10;
}
else{
break;
}
}
vector<int> digs;
ll ot = cur;
for(int i = 0;i<dig;++i){
digs.push_back(ot%10);
ot /= 10;
}
bool pal = true;
for(int i = 0;i<dig;++i){
if(digs[i] != digs[dig-i-1]){
pal = false;
break;
}
}
if(pal){
cout << "Palindrome!\n";
}
else{
cout << cur << "\n";
}
++cur;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |