Submission #121618

#TimeUsernameProblemLanguageResultExecution timeMemory
121618sofhiasouzaPalindrome-Free Numbers (BOI13_numbers)C++14
25 / 100
1089 ms460 KiB
#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)

numbers.cpp: In function 'int main()':
numbers.cpp:19:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j = 0 ; j < s.size() ; j++)
                   ~~^~~~~~~~~~
numbers.cpp:21:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int k = j+1 ; k < s.size() ; k++)
                      ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...