Submission #963028

#TimeUsernameProblemLanguageResultExecution timeMemory
963028marinalucaPalindromes (info1cup18_palindromes)C++14
100 / 100
89 ms10100 KiB
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

#pragma GCC optimize ("O4")
#pragma GCC optimize ("fast-math")
#pragma GCC optimize ("unroll-loops")

using namespace std;
#define int long long
#define ll long long
#define XX first
#define YY second
#define pb push_back
#define sz (x) int(x.size())
#define pf pop_front
#define pob pop_back
#define pff push_front

int solve (int n){
    int ans = 0;
    while (n){
        ans = ans * 10 + n % 10;
        n /= 10;
    }
    return ans;
}
signed main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin >> n;
    int sum = 0;
    for (int i = 0; i < n; ++ i){
        int x;
        cin >> x;
        if (x == solve(x))
            sum += x;
    }
    cout << sum;
    return 0 ^ 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...