Submission #1296480

#TimeUsernameProblemLanguageResultExecution timeMemory
1296480okahak71Palindrome-Free Numbers (BOI13_numbers)C++20
45 / 100
1096 ms728 KiB
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); long long a, b; if(!(cin >> a >> b)) return 0; long long ans = 0; while(a <= b){ bool add = true; long long k = a; int q = -1, qp = -1, qpp = -1; while(k > 0){ qpp = qp; qp = q; q = int(k % 10); if(q == qpp || q == qp){ add = false; break; } k /= 10; } ans += add; a++; } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...