# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
98108 | tushar_2658 | Palindromes (info1cup18_palindromes) | C++14 | 391 ms | 12308 KiB |
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"
using namespace std;
typedef long long ll;
#define file freopen("in.txt", "r", stdin);
const int maxn = 1e6 + 5;
ll arr[maxn], sum = 0;
int n;
bool check(ll n){
string s = to_string(n);
string s1 = s;
reverse(s.begin(), s.end());
return (s == s1);
}
int main(){
//file
scanf("%d", &n);
for(int i=0; i<n; i++){
scanf("%lld", &arr[i]);
}
for(int i=0; i<n; i++){
if(check(arr[i]))sum += arr[i];
}
printf("%lld\n", sum);
}
Compilation message (stderr)
# | 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... |