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>
using namespace std;
#define pb push_back
#define mp make_pair
const int siz = 0;
const int mod = 0;
bool pal(long long i) {
string s = to_string(i);
int j = 0; int k = s.length()-1;
while(j<k) {
if(s[j] != s[k]) return false;
j++; k--;
}
return true;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
long long s, e;
cin >> s >> e;
for(long long i=s; i<=e; i++) {
if(pal(i)) {
cout << "Palindrome!\n";
}
else {
cout << i << "\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... |