Submission #448445

#TimeUsernameProblemLanguageResultExecution timeMemory
448445fuad27Palindrome-Free Numbers (BOI13_numbers)C++14
38.33 / 100
1101 ms288 KiB
#include<bits/stdc++.h> using namespace std; bool check(long long s) { long long prev = -1, pprev = -2; while(s > 0) { if(s%10 == prev or s%10 == pprev)return false; pprev = prev; prev = s%10; s/=10; } return true; } int main () { long long a, b, c = 0; cin >> a >> b; for(long long i = a;i<=b;i++) { if(check(i))c++; } cout<<c; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...