# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
448444 | fuad27 | Palindrome-Free Numbers (BOI13_numbers) | C++14 | 1097 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>
using namespace std;
bool check(string s) {
if(s.length() >= 2 and s[0] == s[1])return false;
for(int i = 2;i<s.length();i++) {
if(s[i] == s[i-2] or s[i] == s[i-1])return false;
}
return true;
}
int main () {
long long a, b, c = 0;
cin >> a >> b;
for(long long i = a;i<=b;i++) {
string s = to_string(i);
if(check(s))c++;
}
cout<<c;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |