# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
855188 | ThylOne | Palindrome-Free Numbers (BOI13_numbers) | C++14 | 1094 ms | 600 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;
typedef long long ll;
bool isfree(ll n){
string re = to_string(n);
if(re[0]==re[1])return false;
for(int i=2;i<re.size();i++){
if(re[i]==re[i-1] || re[i]==re[i-2]){
return false;
}
}
return true;
}
signed main(){
ll a,b;
cin>>a>>b;
int cnt=0;
for(ll i=a;i<=b;i++){
cnt+=isfree(i);
}
cout<<cnt<<endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |