Submission #21648666


Source Code Expand

#include <stdio.h>
#include <string.h>

int main () {
  char s[12] = "";
  
  int res = 0;
  int len = 0;
  int idxFirstNZ = 0;
  
  res = scanf("%s", s);

  len = strlen(s);
  idxFirstNZ = len - 1;
  
  while(idxFirstNZ >= 0 && s[idxFirstNZ] == '0') {
    idxFirstNZ--;
  }
  
  if (idxFirstNZ < 1) {
    printf("Yes\n");
    return 0;
  }
  
  for(int i = 0; i <= idxFirstNZ / 2; i++) {
    if(s[i] != s[idxFirstNZ-i]) {
      printf("No\n");
      return 0;
    }
  }
  
  printf("Yes\n");
  
  return 0;
}

Submission Info

Submission Time
Task B - Palindrome with leading zeros
User chro4896
Language C (GCC 9.2.1)
Score 200
Code Size 543 Byte
Status AC
Exec Time 4 ms
Memory 1664 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 25
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, hand_18.txt, hand_19.txt, random_01.txt, random_02.txt, random_03.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
hand_01.txt AC 4 ms 1544 KiB
hand_02.txt AC 1 ms 1600 KiB
hand_03.txt AC 2 ms 1588 KiB
hand_04.txt AC 1 ms 1608 KiB
hand_05.txt AC 1 ms 1512 KiB
hand_06.txt AC 1 ms 1588 KiB
hand_07.txt AC 2 ms 1588 KiB
hand_08.txt AC 1 ms 1604 KiB
hand_09.txt AC 1 ms 1664 KiB
hand_10.txt AC 1 ms 1500 KiB
hand_11.txt AC 3 ms 1564 KiB
hand_12.txt AC 2 ms 1564 KiB
hand_13.txt AC 2 ms 1620 KiB
hand_14.txt AC 2 ms 1616 KiB
hand_15.txt AC 2 ms 1588 KiB
hand_16.txt AC 1 ms 1604 KiB
hand_17.txt AC 1 ms 1608 KiB
hand_18.txt AC 1 ms 1552 KiB
hand_19.txt AC 2 ms 1588 KiB
random_01.txt AC 1 ms 1644 KiB
random_02.txt AC 1 ms 1584 KiB
random_03.txt AC 2 ms 1600 KiB
sample_01.txt AC 1 ms 1504 KiB
sample_02.txt AC 1 ms 1644 KiB
sample_03.txt AC 2 ms 1592 KiB