제출 #121618

#제출 시각아이디문제언어결과실행 시간메모리
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; }

컴파일 시 표준 에러 (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...