Submission #363227

#TimeUsernameProblemLanguageResultExecution timeMemory
363227Tenis0206Palindromes (info1cup18_palindromes)C++14
100 / 100
104 ms9964 KiB
#include <bits/stdc++.h> using namespace std; int n; int main() { ios::sync_with_stdio(false); cin.tie(0); cin>>n; long long rez = 0; for(int i=1;i<=n;i++) { string s; cin>>s; bool ok = true; for(int i=0;i<s.size()/2;i++) { if(s[i]!=s[s.size()-i-1]) { ok = false; break; } } if(ok) { int nr = 0; for(auto it : s) { nr = nr*10 + it - '0'; } rez+=nr; } } cout<<rez<<'\n'; return 0; }

Compilation message (stderr)

palindromes.cpp: In function 'int main()':
palindromes.cpp:16:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for(int i=0;i<s.size()/2;i++)
      |                     ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...