Language: C

#include <stdio.h>
 
int main(void){
  int n, k, r, s, p;
  int score = 0;
  char t[100000];
  scanf("%d %d", &n, &k);
  scanf("%d %d %d", &r, &s, &p);
  scanf("%s", t);
  
  for(int i=0; i < k; i++){
    if(!strcmp(t[i], "r")){
      score = score + p;
    }else if(!strcmp(t[i], "s")){
      score = score + r;
    }else if(!strcmp(t[i], "p")){
      score = score + s;
    }
  }
  
  for(int i = k; i < n; j ++){
    prev[0] = t[i-k];
    if(strcmp(t[i], prev[0])){
      if(!strcmp(t[i], "r")){
        score = score + p;
      }else if(!strcmp(t[i], "s")){
        score = score + r;
      }else if(!strcmp(t[i], "p")){
        score = score + s;
      }
    }
  }
  printf("%d", score);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   12 |     if(!strcmp(t[i], "r")){
      |         ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:12:17: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   12 |     if(!strcmp(t[i], "r")){
      |                ~^~~
      |                 |
      |                 char
main.c:12:17: note: expected 'const char *' but argument is of type 'char'
main.c:14:23: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   14 |     }else if(!strcmp(t[i], "s")){
      |                      ~^~~
      |                       |
      |                       char
main.c:14:23: note: expected 'const char *' but argument is of type 'char'
main.c:16:23: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   16 |     }else if(!strcmp(t[i], "p")){
      |                      ~^~~
      |                       |
      |                       char
main.c:16:23: note: expected 'const char *' but argument is of type 'char'
main.c:21:25: error: 'j' undeclared (first use in this function)
   21 |   for(int i = k; i < n; j ++){
      |                         ^
main.c:21:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:5: error: 'prev' undeclared (first use in this function)
   22 |     prev[0] = t[i-k];
      |     ^~~~
main.c:23:16: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   23 |     if(strcmp(t[i], prev[0])){
      |               ~^~~
      |                |
      |                char
main.c:23:16: note: expected 'const char *' but argument is of type 'char'
main.c:24:19: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   24 |       if(!strcmp(t[i], "r")){
      |                  ~^~~
      |                   |
      |                   char
main.c:24:19: note: expected 'const char *' but argument is of type 'char'
main.c:26:25: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   26 |       }else if(!strcmp(t[i], "s")){
      |                        ~^~~
      |                         |
      |                         char
main.c:26:25: note: expected 'const char *' but argument is of type 'char'
main.c:28:25: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   28 |       }else if(!strcmp(t[i], "p")){
      |                        ~^~~
      |                         |
      |                         char
main.c:28:25: note: expected 'const char *' but argument is of type 'char'