Submission #1307327


Source Code Expand

#include <stdio.h>

int sub(char *ch);

int main(void) {
  char x[200002];
  int h = 1,i,j,a,b,c;
  scanf("%s",x);
  while (h != 0) {
    h = 0;
    a = sub(x);
    for (i = 0; i < a; i++) {
      if (x[i] == 'S' && x[i + 1] == 'T') {
        b = sub(x);
        for (j = i; j < b; j++) {
          if (j + 2 < b) {
            x[j] = x[j + 2];
          } else {
            x[j] = '\0';
          }
        }
        h++;
      }
    }
  }
  a = sub(x);
  printf("%d\n",a);
  return 0;
}

int sub(char *ch) {
  int ca = 0;
  while (ch[ca] != '\0') ca++;
  return ca;
}

Submission Info

Submission Time
Task A - STring
User haruton62
Language C (GCC 5.4.1)
Score 200
Code Size 604 Byte
Status TLE
Exec Time 1055 ms
Memory 384 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:8:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s",x);
   ^

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 200 / 200 0 / 100
Status
AC × 3
AC × 9
AC × 10
TLE × 3
Set Name Test Cases
Sample example0, example1, example2
Subtask1 example0, example1, example2, sub_corner0, sub_corner1, sub_corner2, sub_rand0, handmade0, handmade1
All corner0, corner1, corner2, example0, example1, example2, handmade0, handmade1, maxrand0, sub_corner0, sub_corner1, sub_corner2, sub_rand0
Case Name Status Exec Time Memory
corner0 TLE 1055 ms 384 KB
corner1 AC 44 ms 384 KB
corner2 TLE 1055 ms 384 KB
example0 AC 1 ms 128 KB
example1 AC 1 ms 128 KB
example2 AC 1 ms 128 KB
handmade0 AC 1 ms 128 KB
handmade1 AC 1 ms 128 KB
maxrand0 TLE 1055 ms 384 KB
sub_corner0 AC 1 ms 128 KB
sub_corner1 AC 0 ms 128 KB
sub_corner2 AC 1 ms 128 KB
sub_rand0 AC 1 ms 128 KB