# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
500739 | MurotY | Palindrome-Free Numbers (BOI13_numbers) | C++14 | 1093 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 ios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ff first
#define ll long long
#define ss second
using namespace std;
const int N=1e6+1;
bool ok(ll n){
string s;
while (n){
s=char(48+(n % 10))+s;
n/=10;
}
for (int i=0;i<s.size();i++){
for (int j=i+1;j<s.size();j++){
int q=j;
bool ok=1;
for (int j1=i;j1<=j;j1++){
if (s[j1] != s[q]){
ok=0;
break;
}
q--;
}
if (ok) return 1;
}
}
return 0;
}
int main()
{
ll a, b, ans=0;
cin >> a >> b;
for (int i=a;i<=b;i++){
if (!ok(i)) ans++;
}
cout << ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |