답안 #397040

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
397040 2021-05-01T08:40:37 Z tibinyte Palindromes (info1cup18_palindromes) C++14
100 / 100
587 ms 9992 KB
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <bitset>
#include <string>
#include <unordered_map>
#define mod 1000000007
using namespace std;
bool is_pal(int n) {
	string s = to_string(n);
	string aux = s;
	reverse(s.begin(), s.end());
	return (s == aux);
}
int main() {
	int n , x;
	long long sum = 0;
	cin >> n;
	while (n--) {
		cin >> x;
		if (is_pal(x)) {
			sum += x;
		}
	}
	cout << sum;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 8 ms 308 KB Output is correct
3 Correct 296 ms 4996 KB Output is correct
4 Correct 447 ms 7496 KB Output is correct
5 Correct 565 ms 9864 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 4 ms 336 KB Output is correct
3 Correct 172 ms 1676 KB Output is correct
4 Correct 337 ms 3076 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 4 ms 336 KB Output is correct
3 Correct 172 ms 1676 KB Output is correct
4 Correct 337 ms 3076 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 8 ms 332 KB Output is correct
7 Correct 303 ms 3200 KB Output is correct
8 Correct 365 ms 3976 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 8 ms 308 KB Output is correct
3 Correct 296 ms 4996 KB Output is correct
4 Correct 447 ms 7496 KB Output is correct
5 Correct 565 ms 9864 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 4 ms 336 KB Output is correct
8 Correct 172 ms 1676 KB Output is correct
9 Correct 337 ms 3076 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 8 ms 332 KB Output is correct
12 Correct 303 ms 3200 KB Output is correct
13 Correct 365 ms 3976 KB Output is correct
14 Correct 1 ms 292 KB Output is correct
15 Correct 18 ms 588 KB Output is correct
16 Correct 227 ms 4112 KB Output is correct
17 Correct 517 ms 8848 KB Output is correct
18 Correct 569 ms 9924 KB Output is correct
19 Correct 572 ms 9940 KB Output is correct
20 Correct 587 ms 9992 KB Output is correct