Submission #448410

#TimeUsernameProblemLanguageResultExecution timeMemory
448410fuad27Palindrome-Free Numbers (BOI13_numbers)C++14
22.50 / 100
1099 ms332 KiB
#include<bits/stdc++.h> using namespace std; bool is_palindrome(string s, int l, int r) { bool check = true; if(l >= r-1)return false; for(int i = l;i<l + (r - l)/2;i++) { if(s[i] != s[r - i + l - 1]) { check = false;break; } } if(check == true)return true; return is_palindrome(s, l, r-1) | is_palindrome(s, l + 1, r); } int main () { long long a, b, c = 0; cin >> a >> b; for(int i = a;i<=b;i++) { string k = to_string(i); if(!is_palindrome(k, 0, k.length())) { c++; } }cout<<c<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...