Submission #397040

#TimeUsernameProblemLanguageResultExecution timeMemory
397040tibinytePalindromes (info1cup18_palindromes)C++14
100 / 100
587 ms9992 KiB
#include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <set> #include <bitset> #include <string> #include <unordered_map> #define mod 1000000007 using namespace std; bool is_pal(int n) { string s = to_string(n); string aux = s; reverse(s.begin(), s.end()); return (s == aux); } int main() { int n , x; long long sum = 0; cin >> n; while (n--) { cin >> x; if (is_pal(x)) { sum += x; } } cout << sum; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...