제출 #1051099

#제출 시각아이디문제언어결과실행 시간메모리
1051099VMaksimoski008Palindromes (info1cup18_palindromes)C++17
100 / 100
235 ms10068 KiB
#include <bits/stdc++.h>
//#define int long long

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int mod = 1e9 + 7;
const int LOG = 20;
const int maxn = 1e5 + 5;

signed main() {
    int n;
    cin >> n;

    ll ans = 0;

    for(int i=0; i<n; i++) {
        ll x, y;
        cin >> x; y = x;

        bool ok = 1;

        string s = to_string(y);
        int l=0, r=s.size()-1;
        while(l < r && ok) {
            if(s[l] != s[r]) ok = 0;
            l++; r--;
        }

        if(ok) ans += x;
    }

    cout << ans << '\n';
    return 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...