# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
448423 | osmanallazov | Palindrome-Free Numbers (BOI13_numbers) | C++14 | 1098 ms | 292 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>
#define ll long long
using namespace std;
bool check(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 false;
}
}
}
return true;
}
int main(){
ll a,b,say=0;
cin>>a>>b;
for(int i=a;i<=b;i++){
string s=to_string(i);
if(check(s)){
say++;
}
}
cout<<say;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |