답안 #96029

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
96029 2019-02-05T10:12:37 Z alextodoran Palindromes (info1cup18_palindromes) C++14
100 / 100
449 ms 10020 KB
#include <bits/stdc++.h>

#define ll long long

using namespace std;

int n;

ll s;

vector <int> c;

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        int e;
        cin >> e;
        int e1 = e;
        c.clear();
        while(e)
        {
            c.push_back(e % 10);
            e /= 10;
        }
        bool ok = 1;
        for(int i = 0; i < c.size() / 2; i++)
            if(c[i] != c[c.size() - i - 1])
            {
                ok = 0;
                break;
            }
        s += ok * e1;
    }
    cout << s << "\n";
    return 0;
}

Compilation message

palindromes.cpp: In function 'int main()':
palindromes.cpp:28:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i = 0; i < c.size() / 2; i++)
                        ~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 7 ms 508 KB Output is correct
3 Correct 220 ms 5112 KB Output is correct
4 Correct 348 ms 7544 KB Output is correct
5 Correct 448 ms 10020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 4 ms 376 KB Output is correct
3 Correct 93 ms 1788 KB Output is correct
4 Correct 185 ms 3192 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 4 ms 376 KB Output is correct
3 Correct 93 ms 1788 KB Output is correct
4 Correct 185 ms 3192 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 6 ms 376 KB Output is correct
7 Correct 174 ms 3292 KB Output is correct
8 Correct 217 ms 4084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 7 ms 508 KB Output is correct
3 Correct 220 ms 5112 KB Output is correct
4 Correct 348 ms 7544 KB Output is correct
5 Correct 448 ms 10020 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 4 ms 376 KB Output is correct
8 Correct 93 ms 1788 KB Output is correct
9 Correct 185 ms 3192 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 6 ms 376 KB Output is correct
12 Correct 174 ms 3292 KB Output is correct
13 Correct 217 ms 4084 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 15 ms 632 KB Output is correct
16 Correct 175 ms 4180 KB Output is correct
17 Correct 394 ms 8952 KB Output is correct
18 Correct 449 ms 9972 KB Output is correct
19 Correct 434 ms 9936 KB Output is correct
20 Correct 436 ms 9948 KB Output is correct