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 <bits/stdc++.h>
#define int long long
using namespace std;
int ans = 0;
int f(int x){
string s = to_string(x), t; t = s; reverse(t.begin(), t.end());
return (s == t) * x;
}
int32_t main(){
int n; cin >> n;
for(int i = 0; i < n; i++){
int x; cin >> x; ans += f(x);
}
cout << ans << endl;
}
# | 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... |