# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
121618 | sofhiasouza | Palindrome-Free Numbers (BOI13_numbers) | C++14 | 1089 ms | 460 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>
using namespace std;
typedef long long int ll;
int main()
{
ll a, b;
cin >> a >> b;
int cont = 0, cont2 = 0;
for(ll i = a ; i <= b ; i++)
{
string s;
stringstream ans;
ans << i;
ans >> s;
int flag = 0;
for(int j = 0 ; j < s.size() ; j++)
{
for(int k = j+1 ; k < s.size() ; k++)
{
string aux = "";
for(int p = j ; p <= k ; p++) aux.push_back(s[p]);
string aux2 = aux;
reverse(aux2.begin(), aux2.end());
if(aux == aux2) flag = 1;
}
}
if(flag)
{
//cout << i << endl;
cont2++;
}
cont++;
}
cout << cont - cont2 << endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |