답안 #637178

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
637178 2022-08-31T17:54:42 Z tvladm2009 Palindromes (info1cup18_palindromes) C++14
100 / 100
397 ms 10064 KB
#include <iostream>

using namespace std;

typedef long long ll;

int n;

bool epal(int x) {
    int cx = x;
    ll pal = 0;
    while (x) {
        pal = pal * 10 + x % 10;
        x /= 10;
    }
    return pal == cx;
}

int main() {
    cin >> n;
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        int x;
        cin >> x;
        ans += x * epal(x);
    }
    cout << ans;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 5 ms 308 KB Output is correct
3 Correct 207 ms 5124 KB Output is correct
4 Correct 316 ms 7444 KB Output is correct
5 Correct 397 ms 10064 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 2 ms 312 KB Output is correct
3 Correct 81 ms 1672 KB Output is correct
4 Correct 169 ms 3080 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 2 ms 312 KB Output is correct
3 Correct 81 ms 1672 KB Output is correct
4 Correct 169 ms 3080 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 4 ms 376 KB Output is correct
7 Correct 155 ms 3212 KB Output is correct
8 Correct 197 ms 4092 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 5 ms 308 KB Output is correct
3 Correct 207 ms 5124 KB Output is correct
4 Correct 316 ms 7444 KB Output is correct
5 Correct 397 ms 10064 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 2 ms 312 KB Output is correct
8 Correct 81 ms 1672 KB Output is correct
9 Correct 169 ms 3080 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 4 ms 376 KB Output is correct
12 Correct 155 ms 3212 KB Output is correct
13 Correct 197 ms 4092 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 13 ms 532 KB Output is correct
16 Correct 158 ms 4104 KB Output is correct
17 Correct 354 ms 8972 KB Output is correct
18 Correct 391 ms 9876 KB Output is correct
19 Correct 389 ms 9888 KB Output is correct
20 Correct 384 ms 10004 KB Output is correct