Submission #1051099

# Submission time Handle Problem Language Result Execution time Memory
1051099 2024-08-09T19:43:50 Z VMaksimoski008 Palindromes (info1cup18_palindromes) C++17
100 / 100
235 ms 10068 KB
#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 time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 3 ms 348 KB Output is correct
3 Correct 101 ms 5140 KB Output is correct
4 Correct 153 ms 7436 KB Output is correct
5 Correct 235 ms 10004 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 43 ms 1692 KB Output is correct
4 Correct 94 ms 3084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 43 ms 1692 KB Output is correct
4 Correct 94 ms 3084 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 82 ms 3220 KB Output is correct
8 Correct 101 ms 4104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 3 ms 348 KB Output is correct
3 Correct 101 ms 5140 KB Output is correct
4 Correct 153 ms 7436 KB Output is correct
5 Correct 235 ms 10004 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 43 ms 1692 KB Output is correct
9 Correct 94 ms 3084 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 2 ms 348 KB Output is correct
12 Correct 82 ms 3220 KB Output is correct
13 Correct 101 ms 4104 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 7 ms 604 KB Output is correct
16 Correct 86 ms 4108 KB Output is correct
17 Correct 186 ms 8984 KB Output is correct
18 Correct 207 ms 10004 KB Output is correct
19 Correct 208 ms 10068 KB Output is correct
20 Correct 215 ms 10004 KB Output is correct