Submission #1360811

#TimeUsernameProblemLanguageResultExecution timeMemory
1360811ozner77Palindrome-Free Numbers (BOI13_numbers)Pypy 3
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
bool palin(string s){
    for(int i=0;i<s.size();i++){
        if(i>0){
            if(s[i]==s[i-1]){
                return true;
            }
        }
        if(i>1){
            if(s[i]==s[i-2]){
                return true;
            }
        }
    }
    return false;
}
int main(){
    ll a,b;
    cin>>a>>b;
    ll res=0;
    for(int i=a;i<=b;i++){
        if(palin(to_string(i))){
            res++;
        }
    }
    cout<<b-a+1-res;
}

Compilation message (stdout)

Compiling 'numbers.py'...
***   File "numbers.py", line 2
    using namespace std;
    ^
SyntaxError: invalid syntax. Perhaps you forgot a comma?


=======