# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
448424 | fuad27 | Palindrome-Free Numbers (BOI13_numbers) | C++14 | 1098 ms | 324 KiB |
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;
bool is_palindrome(string s) {
for(int i=0;i<s.size();i++){
string k="";
k+=s[i];
for(int j=i+1;j<s.size();j++){
k+=s[j];
string l=k;
reverse(l.begin(),l.end());
if(k==l){
return true;
}
}
}
return false;
}
int main () {
long long a, b, c = 0;
cin >> a >> b;
for(int i = a;i<=b;i++) {
string k = to_string(i);
if(!is_palindrome(k)) {
c++;
}
}cout<<c<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |