#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
const int MOD = 1e9 + 7;
const int INF = 1e15;
const int N = 1e6;
int n, m, k, a, b, c, d, h, l, r, q, u, v, x, y;
vector<int> arr(N);
void solve() {
cin >> l >> r;
for(int i = l; i<=r; i++) {
string s = to_string(i);
n = s.length();
bool palindrome = true;
for(int j = 0; j<n; j++) {
if(s[j] != s[n-j-1]) {
palindrome = false;
break;
}
}
if(palindrome) cout << "Palindrome!";
else cout << i;
cout << "\n";
}
}
int32_t main() {
ios::sync_with_stdio(false);
cout.tie(0); cin.tie(0);
int tc = 1;
// cin >> tc;
while(tc--) {
solve();
// cout << "\n";
}
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... |