#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector <int> a(n);
for(int i=0;i<n;i++){
cin>>a[i];
}
long long ans=0;
for(int i=0;i<n;i++){
string s=to_string(a[i]);
string t=to_string(a[i]);
reverse(s.begin(),s.end());
if(s==t){
ans+=a[i];
}
}
cout<<ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
6 ms |
468 KB |
Output is correct |
3 |
Correct |
211 ms |
6988 KB |
Output is correct |
4 |
Correct |
311 ms |
10524 KB |
Output is correct |
5 |
Correct |
412 ms |
13920 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
91 ms |
3648 KB |
Output is correct |
4 |
Correct |
177 ms |
7008 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
91 ms |
3648 KB |
Output is correct |
4 |
Correct |
177 ms |
7008 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
5 ms |
460 KB |
Output is correct |
7 |
Correct |
168 ms |
6348 KB |
Output is correct |
8 |
Correct |
221 ms |
7904 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
6 ms |
468 KB |
Output is correct |
3 |
Correct |
211 ms |
6988 KB |
Output is correct |
4 |
Correct |
311 ms |
10524 KB |
Output is correct |
5 |
Correct |
412 ms |
13920 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
2 ms |
340 KB |
Output is correct |
8 |
Correct |
91 ms |
3648 KB |
Output is correct |
9 |
Correct |
177 ms |
7008 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
5 ms |
460 KB |
Output is correct |
12 |
Correct |
168 ms |
6348 KB |
Output is correct |
13 |
Correct |
221 ms |
7904 KB |
Output is correct |
14 |
Correct |
1 ms |
308 KB |
Output is correct |
15 |
Correct |
13 ms |
652 KB |
Output is correct |
16 |
Correct |
163 ms |
5684 KB |
Output is correct |
17 |
Correct |
387 ms |
12504 KB |
Output is correct |
18 |
Correct |
412 ms |
13808 KB |
Output is correct |
19 |
Correct |
399 ms |
13808 KB |
Output is correct |
20 |
Correct |
413 ms |
13792 KB |
Output is correct |