답안 #363227

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
363227 2021-02-05T10:10:49 Z Tenis0206 Palindromes (info1cup18_palindromes) C++14
100 / 100
104 ms 9964 KB
#include <bits/stdc++.h>

using namespace std;
int n;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n;
    long long rez = 0;
    for(int i=1;i<=n;i++)
    {
        string s;
        cin>>s;
        bool ok = true;
        for(int i=0;i<s.size()/2;i++)
        {
            if(s[i]!=s[s.size()-i-1])
            {
                ok = false;
                break;
            }
        }
        if(ok)
        {
            int nr = 0;
            for(auto it : s)
            {
                nr = nr*10 + it - '0';
            }
            rez+=nr;
        }
    }
    cout<<rez<<'\n';
    return 0;
}

Compilation message

palindromes.cpp: In function 'int main()':
palindromes.cpp:16:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for(int i=0;i<s.size()/2;i++)
      |                     ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 53 ms 5228 KB Output is correct
4 Correct 80 ms 7532 KB Output is correct
5 Correct 104 ms 9964 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 40 ms 1772 KB Output is correct
4 Correct 81 ms 3180 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 40 ms 1772 KB Output is correct
4 Correct 81 ms 3180 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 364 KB Output is correct
7 Correct 68 ms 3436 KB Output is correct
8 Correct 81 ms 4204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 53 ms 5228 KB Output is correct
4 Correct 80 ms 7532 KB Output is correct
5 Correct 104 ms 9964 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 40 ms 1772 KB Output is correct
9 Correct 81 ms 3180 KB Output is correct
10 Correct 1 ms 364 KB Output is correct
11 Correct 2 ms 364 KB Output is correct
12 Correct 68 ms 3436 KB Output is correct
13 Correct 81 ms 4204 KB Output is correct
14 Correct 1 ms 364 KB Output is correct
15 Correct 4 ms 620 KB Output is correct
16 Correct 39 ms 4224 KB Output is correct
17 Correct 88 ms 9196 KB Output is correct
18 Correct 101 ms 9964 KB Output is correct
19 Correct 94 ms 9964 KB Output is correct
20 Correct 102 ms 9964 KB Output is correct