#include<stdio.h>
#include<string.h>
char str[300000];
int palindrome(int size)
{
int i, j;
int ok=1;
for(i=size;;i++)
{
ok=1;
for(j=0;j<size;j++)
{
if((i-j-1)<size && str[j]!=str[i-j-1] )
{
printf("%d번째 : %c %c\n",i, str[j], str[i-j-1]);
ok=0;
break;
}
}
if(ok) return i;
}
}
int main()
{
int str_length=0;
char a='0';
while(a!='\n'&&str_length<50)
{
scanf("%c", &a);
str[str_length] = a;
str_length++;
}
printf("%d", palindrome(str_length-1));
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1380 KB |
Output is correct - answer is '7' |
2 |
Incorrect |
0 ms |
1380 KB |
Output isn't correct - expected '4', found '3' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |