Submission #1296477

#TimeUsernameProblemLanguageResultExecution timeMemory
1296477okahak71Palindrome-Free Numbers (BOI13_numbers)C++20
62.50 / 100
846 ms580 KiB
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int a, b, ans = 0; cin >> a >> b;
    while(a <= b){
        bool add = 1;
        int k = a, q = -1, qp = -1, qpp;
        while(k > 0){
            qpp = qp;
            qp = q;
            q = k % 10;
            if(q == qpp or q == qp){
                add = 0;
                break;
            }
            k /= 10;
        }
        ans += add;
        a++;
    } cout << ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...