Submission #978200

# Submission time Handle Problem Language Result Execution time Memory
978200 2024-05-09T03:00:39 Z 12345678 Palindromes (info1cup18_palindromes) C++17
100 / 100
219 ms 10068 KB
#include <bits/stdc++.h>

using namespace std;

int n, x, tmp;
long long res;

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>n;
    while (n--)
    {
        vector<int> v;
        int f=0;
        cin>>x;
        tmp=x;
        while (tmp>0) v.push_back(tmp%10), tmp/=10;
        for (int i=0, j=v.size()-1; i<=j; i++, j--) if (v[i]!=v[j]) f=1;
        if (!f) res+=x;
    }
    cout<<res;
}
# 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 95 ms 5036 KB Output is correct
4 Correct 149 ms 7600 KB Output is correct
5 Correct 190 ms 10028 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 46 ms 1708 KB Output is correct
4 Correct 94 ms 3244 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 46 ms 1708 KB Output is correct
4 Correct 94 ms 3244 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 3 ms 348 KB Output is correct
7 Correct 93 ms 3372 KB Output is correct
8 Correct 123 ms 4004 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 95 ms 5036 KB Output is correct
4 Correct 149 ms 7600 KB Output is correct
5 Correct 190 ms 10028 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 46 ms 1708 KB Output is correct
9 Correct 94 ms 3244 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 3 ms 348 KB Output is correct
12 Correct 93 ms 3372 KB Output is correct
13 Correct 123 ms 4004 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 7 ms 604 KB Output is correct
16 Correct 78 ms 4260 KB Output is correct
17 Correct 171 ms 8880 KB Output is correct
18 Correct 192 ms 10040 KB Output is correct
19 Correct 193 ms 10028 KB Output is correct
20 Correct 219 ms 10068 KB Output is correct