Submission #14959457


Source Code Expand

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

int main() {
  char* line1;
  char* line2;
  int i;
  int n;
  int cnt;
  line1 = (char*)malloc(sizeof(char)*200005);
  line2 = (char*)malloc(sizeof(char)*200005);
  fgets(line1, 200005, stdin);
  fgets(line2, 200005, stdin);
  n = strlen(line1);
  cnt = 0;
  for ( i = 0; i < n; i++ ) {
    if (line1[i] != line2[i]) {
      cnt++;
    }
  }
  printf("%d\n", cnt);
  free(line1);
  free(line2);
  return 0;
}

Submission Info

Submission Time
Task B - Minor Change
User nophey
Language C (GCC 9.2.1)
Score 200
Code Size 495 Byte
Status AC
Exec Time 6 ms
Memory 1768 KiB

Compile Error

./Main.c: In function ‘main’:
./Main.c:13:3: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
   13 |   fgets(line1, 200005, stdin);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./Main.c:14:3: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
   14 |   fgets(line2, 200005, stdin);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
random_01.txt AC 6 ms 1616 KiB
random_02.txt AC 2 ms 1592 KiB
random_03.txt AC 2 ms 1668 KiB
random_04.txt AC 1 ms 1604 KiB
random_05.txt AC 1 ms 1716 KiB
random_06.txt AC 3 ms 1612 KiB
random_07.txt AC 2 ms 1768 KiB
random_08.txt AC 1 ms 1560 KiB
random_09.txt AC 2 ms 1672 KiB
random_10.txt AC 2 ms 1596 KiB
sample_01.txt AC 1 ms 1496 KiB
sample_02.txt AC 1 ms 1568 KiB
sample_03.txt AC 1 ms 1484 KiB