# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121031 | vjudge1 | Palindrome-Free Numbers (BOI13_numbers) | C++17 | 1081 ms | 504 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){
if (x >= 100) ok &= (x / 100) % 10 != x % 10;
if (x >= 10) ok &= (x / 10) % 10 != 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... |