# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121035 | raul2008487 | Palindrome-Free Numbers (BOI13_numbers) | C++17 | 1074 ms | 508 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>
#define ll long long
#define pb push_back
#define in insert
#define fi first
#define se second
#define vl vector<ll>
#define all(v) v.begin(), v.end()
#define endl "\n"
using namespace std;
const int sz = 1e6 + 5; /// mind this
const int MAX = 2e6 + 123;
const int BS = 61;
const int mod = 998244353;
void solve(){
ll a, b, i, j, ans = 0;
cin >> a >> b;
for(i = a; i <= b; i++){
ll x = i;
bool ok = 1;
while(x > 10){
ll m = (x % 1000);
if(x > 100)ok &= ((ll)(m % 10) != (ll)(m / 100));
m = (x % 100);
ok &= ((ll)(m % 10) != (ll)(m / 10));
if(!ok){break;}
x /= 10;
}
ans += ok;
}
cout << ans << endl;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll t = 1;
// cin >> t;
while(t--){
solve();
}
}
/*
123 321
*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |