Submission #966236

# Submission time Handle Problem Language Result Execution time Memory
966236 2024-04-19T14:47:40 Z 3laa Palindrome-Free Numbers (BOI13_numbers) C++14
25 / 100
10 ms 600 KB
//freopen(".in","r",stdin);freopen(".out","w",stdout);
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#include <bits/stdc++.h>
#include <unordered_map>
#define endl '\n'
#define mid ((l+r)/2)
#define  F first
#define  S second
#define pb push_back
#define yes void (cout<<"YES"<<endl)
#define no void (cout<<"NO"<<endl)
#define ump unordered_map <ll,ll>
#define sp " "
#define vll vector<ll>
#define vint vector<int>
#define vp vector<pll>
#define pll pair<ll,ll>
#define mem(x,val) memset(x,val,sizeof(x))
typedef long double ld;
typedef long long ll;
using namespace std;
const ll inf=2e18+9;
const ll M=1e9+7;
ll a,b,ans;
int main(){
    fast;
    cin>>a>>b;
    if(b-a<=1000000){
        for(ll i=a ; i<=b  ;i++){
            string s=to_string(i);
            ll n=s.size(),gg=1;
            s+="*?";
            for(ll i=0 ; i<n ;i++)
                if(s[i]==s[i+1]||s[i]==s[i+2])
                     gg=0;
            ans+=gg;
        }
    }
    else{
        ans=((b-a))/6;
    }
    cout<<ans<<endl;

}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 10 ms 348 KB Output is correct
4 Correct 4 ms 452 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 600 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 2 ms 348 KB Output is correct
15 Correct 2 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 10 ms 456 KB Output is correct
20 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Incorrect 1 ms 348 KB Output isn't correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Incorrect 0 ms 348 KB Output isn't correct
8 Incorrect 1 ms 348 KB Output isn't correct
9 Incorrect 0 ms 348 KB Output isn't correct
10 Incorrect 1 ms 348 KB Output isn't correct
11 Incorrect 0 ms 348 KB Output isn't correct
12 Incorrect 0 ms 348 KB Output isn't correct
13 Incorrect 0 ms 348 KB Output isn't correct
14 Incorrect 0 ms 344 KB Output isn't correct
15 Incorrect 0 ms 348 KB Output isn't correct
16 Incorrect 0 ms 348 KB Output isn't correct
17 Incorrect 0 ms 344 KB Output isn't correct
18 Incorrect 1 ms 344 KB Output isn't correct
19 Incorrect 1 ms 348 KB Output isn't correct
20 Incorrect 0 ms 348 KB Output isn't correct
21 Incorrect 0 ms 344 KB Output isn't correct
22 Incorrect 0 ms 348 KB Output isn't correct
23 Incorrect 0 ms 348 KB Output isn't correct
24 Incorrect 3 ms 452 KB Output isn't correct
25 Incorrect 0 ms 348 KB Output isn't correct
26 Incorrect 1 ms 348 KB Output isn't correct
27 Incorrect 0 ms 348 KB Output isn't correct
28 Incorrect 1 ms 348 KB Output isn't correct
29 Incorrect 1 ms 348 KB Output isn't correct
30 Incorrect 0 ms 344 KB Output isn't correct
31 Incorrect 1 ms 348 KB Output isn't correct
32 Incorrect 0 ms 348 KB Output isn't correct
33 Incorrect 0 ms 348 KB Output isn't correct
34 Incorrect 0 ms 348 KB Output isn't correct
35 Incorrect 1 ms 348 KB Output isn't correct
36 Incorrect 1 ms 348 KB Output isn't correct
37 Incorrect 1 ms 348 KB Output isn't correct
38 Incorrect 0 ms 348 KB Output isn't correct
39 Incorrect 0 ms 352 KB Output isn't correct
40 Incorrect 1 ms 596 KB Output isn't correct
41 Incorrect 0 ms 348 KB Output isn't correct
42 Incorrect 1 ms 600 KB Output isn't correct
43 Incorrect 0 ms 348 KB Output isn't correct
44 Incorrect 0 ms 348 KB Output isn't correct
45 Incorrect 1 ms 348 KB Output isn't correct