#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
#pragma GCC optimize ("O4")
#pragma GCC optimize ("fast-math")
#pragma GCC optimize ("unroll-loops")
using namespace std;
#define int long long
#define ll long long
#define XX first
#define YY second
#define pb push_back
#define sz (x) int(x.size())
#define pf pop_front
#define pob pop_back
#define pff push_front
int solve (int n){
int ans = 0;
while (n){
ans = ans * 10 + n % 10;
n /= 10;
}
return ans;
}
signed main(void){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
int sum = 0;
for (int i = 0; i < n; ++ i){
int x;
cin >> x;
if (x == solve(x))
sum += x;
}
cout << sum;
return 0 ^ 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
44 ms |
5040 KB |
Output is correct |
4 |
Correct |
66 ms |
7680 KB |
Output is correct |
5 |
Correct |
86 ms |
10068 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
24 ms |
1700 KB |
Output is correct |
4 |
Correct |
52 ms |
3108 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
24 ms |
1700 KB |
Output is correct |
4 |
Correct |
52 ms |
3108 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
43 ms |
3488 KB |
Output is correct |
8 |
Correct |
54 ms |
4168 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
44 ms |
5040 KB |
Output is correct |
4 |
Correct |
66 ms |
7680 KB |
Output is correct |
5 |
Correct |
86 ms |
10068 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
24 ms |
1700 KB |
Output is correct |
9 |
Correct |
52 ms |
3108 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
2 ms |
348 KB |
Output is correct |
12 |
Correct |
43 ms |
3488 KB |
Output is correct |
13 |
Correct |
54 ms |
4168 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
3 ms |
752 KB |
Output is correct |
16 |
Correct |
36 ms |
4436 KB |
Output is correct |
17 |
Correct |
81 ms |
9008 KB |
Output is correct |
18 |
Correct |
87 ms |
9904 KB |
Output is correct |
19 |
Correct |
87 ms |
10024 KB |
Output is correct |
20 |
Correct |
89 ms |
10100 KB |
Output is correct |