#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <array>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <set>
#define INF 1e9
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll MAXN = 100005;
struct point {
int x, y;
point(int _x = INF, int _y = INF) : x(_x), y(_y) {}
};
int f(point function, int x) {
if (function.x == INF) return INF;
return function.x * x + function.y;
}
struct LiChao {
vector<point> t;
int n;
LiChao(int _n) {
n = _n;
t.resize(n * 4);
}
int query(int v, int l, int r, int x) {
int mid = (l + r) / 2;
if (l == r) return f(t[v], x);
if (x <= mid) return min(f(t[v], x), query(v * 2 + 1, l, mid, x));
else return min(f(t[v], x), query(v * 2 + 2, mid + 1, r, x));
}
void update(int v, int l, int r, point val) {
int mid = (l + r) / 2;
bool lef = f(val, l) < f(t[v], l);
bool md = f(val, mid) < f(t[v], mid);
if (md) swap(t[v], val);
if (l == r) return;
if (lef != md) update(v * 2 + 1, l, mid, val);
else update(v * 2 + 2, mid + 1, r, val);
}
int query(int point) {
return query(0, 0, n - 1, point);
}
void update(point val) {
update(0, 0, n - 1, val);
}
};
bool prime(ll n) {
if (n < 2) return false;
for (ll x = 2; x * x <= n; x++) {
if (n % x == 0) return false;
}
return true;
}
void solve()
{
ll s, e; cin >> s >> e;
for (ll i = s; i <= e; i++) {
string x = to_string(i);
string y = x;
reverse(y.begin(), y.end());
if (x == y) { cout << "Palindrome!" << "\n"; }
else cout << i << "\n";
}
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1; //cin >> t;
while (t--) solve();
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... |