| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1288562 | Faisal_Saqib | Palindrome-Free Numbers (BOI13_numbers) | C++20 | 1097 ms | 588 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
bool check(ll x)
{
string s=to_string(x);
for(int i=0;i<s.size();i++)
{
if(i>0 and s[i]==s[i-1])return 0;
if(i>1 and s[i-2]==s[i])return 0;
}
return 1;
}
// set<string> pre[100];
int main()
{
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
ios::sync_with_stdio(0);
cout.tie(0);cin.tie(0);
ll a,b,cnt=0;
cin>>a>>b;
for(ll x=a;x<=b;x++)
{
if(check(x))
{
cnt++;
}
}
cout<<cnt<<endl;
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
