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 <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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |