Submission #403825

# Submission time Handle Problem Language Result Execution time Memory
403825 2021-05-13T13:47:34 Z Iwanttobreakfree Palindromes (info1cup18_palindromes) C++
100 / 100
386 ms 9872 KB
#include <iostream>
#include <string>
using namespace std;
int main(){
	long long int n,tot=0,x;
	bool pos;
	string str;
	cin>>n;
	while(n--){
		cin>>str;
		int m=str.length();
		pos=true;
		for(int i=0;i<m/2;i++){
			if(str[i]!=str[m-i-1]){
				pos=false;
				break;
			}
		}
		if(pos){
			x=0;
			for(int i=0;i<m;i++){
				x*=10;
				x+=str[i]-'0';
			}
			tot+=x;
		}
	}
	cout<<tot;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 5 ms 304 KB Output is correct
3 Correct 184 ms 5008 KB Output is correct
4 Correct 280 ms 7432 KB Output is correct
5 Correct 386 ms 9872 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 412 KB Output is correct
2 Correct 3 ms 304 KB Output is correct
3 Correct 89 ms 1676 KB Output is correct
4 Correct 175 ms 3068 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 412 KB Output is correct
2 Correct 3 ms 304 KB Output is correct
3 Correct 89 ms 1676 KB Output is correct
4 Correct 175 ms 3068 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 6 ms 332 KB Output is correct
7 Correct 167 ms 3208 KB Output is correct
8 Correct 221 ms 3968 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 5 ms 304 KB Output is correct
3 Correct 184 ms 5008 KB Output is correct
4 Correct 280 ms 7432 KB Output is correct
5 Correct 386 ms 9872 KB Output is correct
6 Correct 1 ms 412 KB Output is correct
7 Correct 3 ms 304 KB Output is correct
8 Correct 89 ms 1676 KB Output is correct
9 Correct 175 ms 3068 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 6 ms 332 KB Output is correct
12 Correct 167 ms 3208 KB Output is correct
13 Correct 221 ms 3968 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 12 ms 584 KB Output is correct
16 Correct 144 ms 4096 KB Output is correct
17 Correct 322 ms 8964 KB Output is correct
18 Correct 379 ms 9864 KB Output is correct
19 Correct 352 ms 9868 KB Output is correct
20 Correct 364 ms 9868 KB Output is correct