Submission #45118

# Submission time Handle Problem Language Result Execution time Memory
45118 2018-04-11T10:13:01 Z model_code Palindromes (info1cup18_palindromes) C++17
100 / 100
563 ms 636 KB
#include <iostream>
#include <algorithm>
#include <cassert>

using namespace std;

int main ()
{
    //freopen ("input", "r", stdin);
    //freopen ("output1", "w", stdout);

    int n;cin >> n;

    assert (1 <= n && n <= 1000000);

    long long sum = 0LL;
    for (int i = 1; i <= n; ++i)
    {
        int x;cin >> x;

        assert (1 <= x && x <= 1000000000);

        int cx = x, nr = 0;
        while (cx > 0)
        {
            nr = nr * 10 + cx % 10;
            cx /= 10;
        }

        if (x == nr) sum += 1LL * x;
    }
cout << sum << '\n';

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 14 ms 472 KB Output is correct
3 Correct 253 ms 504 KB Output is correct
4 Correct 435 ms 620 KB Output is correct
5 Correct 563 ms 620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 620 KB Output is correct
2 Correct 4 ms 620 KB Output is correct
3 Correct 126 ms 620 KB Output is correct
4 Correct 288 ms 620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 620 KB Output is correct
2 Correct 4 ms 620 KB Output is correct
3 Correct 126 ms 620 KB Output is correct
4 Correct 288 ms 620 KB Output is correct
5 Correct 2 ms 620 KB Output is correct
6 Correct 7 ms 620 KB Output is correct
7 Correct 220 ms 620 KB Output is correct
8 Correct 344 ms 620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 14 ms 472 KB Output is correct
3 Correct 253 ms 504 KB Output is correct
4 Correct 435 ms 620 KB Output is correct
5 Correct 563 ms 620 KB Output is correct
6 Correct 2 ms 620 KB Output is correct
7 Correct 4 ms 620 KB Output is correct
8 Correct 126 ms 620 KB Output is correct
9 Correct 288 ms 620 KB Output is correct
10 Correct 2 ms 620 KB Output is correct
11 Correct 7 ms 620 KB Output is correct
12 Correct 220 ms 620 KB Output is correct
13 Correct 344 ms 620 KB Output is correct
14 Correct 2 ms 620 KB Output is correct
15 Correct 19 ms 620 KB Output is correct
16 Correct 213 ms 620 KB Output is correct
17 Correct 464 ms 636 KB Output is correct
18 Correct 524 ms 636 KB Output is correct
19 Correct 517 ms 636 KB Output is correct
20 Correct 518 ms 636 KB Output is correct