Submission #1296475

#TimeUsernameProblemLanguageResultExecution timeMemory
1296475okahak71Palindrome-Free Numbers (BOI13_numbers)C++20
38.33 / 100
1096 ms576 KiB
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define ll long long #define vec vector #define pb push_back #define pll array<ll, 2> #define ss second #define ff first #define all(X) X.begin(), X.end() #define allr(X) X.rbegin(), X.rend() using namespace std; const ll inf = 1e18; void _(){ ll a, b , ans = 0; cin >> a >> b; for(ll i = a; i <= b; i++){ bool add = 1; string s = to_string(i); for(ll j = 1; j < s.size(); j++){ if(s[j - 1] == s[j] or (j > 1 and s[j - 2] == s[j])) {add = 0; break;} } ans += add; } cout << ans; } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); _(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...