Language: C

#include <stdio.h>
#include <string.h>
#define N 1000000
#define L 14
char A[N][L];
int getChar(char c);
long long getKey(char str[]);
int h1(int key){ return key%N; }
int h2(int key){ return 1+(key%(N-1)); }
int find(char str[]);
int insert(char str[]);
int main(){
  int i, n;
  char str[L], cmp[9];
  for(i = 0; i < N; i++){
    A[i][0] = ’\0’;
  }
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%s %s", cmp, str);
    if(cmp[0] == ’i’){
      insert(str);
    } else {
      if(find(str)){
        printf("yes\n");
      } else {
        printf("no\n");
} }
}
return 0; }
int getChar(char c){
  if( c == ’A’) return 1;
  else if( c == ’C’) return 2;
  else if( c == ’G’) return 3;
  else if( c == ’T’) return 4;
  else return 0;
}
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for (i = 0; i < strlen(str); i++){
    sum += p*(getChar(str[i]));
p *= 5; }
return sum; }
int find(char str[]){
  int i, h;
  h = (h1(getKey(str)) + i * h2(getKey(str))) % N;
  for(i = 0; i < 14; i++){
    h = (h1(getKey(str)) + i * h2(getKey(str))) % N;
    if(strcmp(A[h], str) == 0) return 1;
  }
return 0; }
int insert(char str[]){
  int i;
  if(find(str)) return 0;
  for(i = 0; i < 14; i++){
    if(A[ (h1(getKey(str)) + i * h2(getKey(str))) % N ][0] == ’\0’){
      strcpy(A[ (h1(getKey(str)) + i * h2(getKey(str))) % N ], str);
      return 1;
} }
return 0; }



Compiler output:
main.c: In function 'main':
main.c:16:15: error: stray '\342' in program
   16 |     A[i][0] = <U+2019>\0<U+2019>;
      |               ^~~~~~~~
main.c:16:16: error: stray '\' in program
   16 |     A[i][0] = ’\0’;
      |                ^
main.c:16:18: error: stray '\342' in program
   16 |     A[i][0] = <U+2019>\0<U+2019>;
      |                         ^~~~~~~~
main.c:21:18: error: stray '\342' in program
   21 |     if(cmp[0] == <U+2019>i<U+2019>){
      |                  ^~~~~~~~
main.c:21:20: error: stray '\342' in program
   21 |     if(cmp[0] == <U+2019>i<U+2019>){
      |                           ^~~~~~~~
main.c: In function 'getChar':
main.c:32:12: error: stray '\342' in program
   32 |   if( c == <U+2019>A<U+2019>) return 1;
      |            ^~~~~~~~
main.c:32:14: error: stray '\342' in program
   32 |   if( c == <U+2019>A<U+2019>) return 1;
      |                     ^~~~~~~~
main.c:32:9: warning: comparison between pointer and integer
   32 |   if( c == ’A’) return 1;
      |         ^~
main.c:33:17: error: stray '\342' in program
   33 |   else if( c == <U+2019>C<U+2019>) return 2;
      |                 ^~~~~~~~
main.c:33:19: error: stray '\342' in program
   33 |   else if( c == <U+2019>C<U+2019>) return 2;
      |                          ^~~~~~~~
main.c:33:18: error: 'C' undeclared (first use in this function)
   33 |   else if( c == ’C’) return 2;
      |                  ^
main.c:33:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:17: error: stray '\342' in program
   34 |   else if( c == <U+2019>G<U+2019>) return 3;
      |                 ^~~~~~~~
main.c:34:19: error: stray '\342' in program
   34 |   else if( c == <U+2019>G<U+2019>) return 3;
      |                          ^~~~~~~~
main.c:34:18: error: 'G' undeclared (first use in this function)
   34 |   else if( c == ’G’) return 3;
      |                  ^
main.c:35:17: error: stray '\342' in program
   35 |   else if( c == <U+2019>T<U+2019>) return 4;
      |                 ^~~~~~~~
main.c:35:19: error: stray '\342' in program
   35 |   else if( c == <U+2019>T<U+2019>) return 4;
      |                          ^~~~~~~~
main.c:35:18: error: 'T' undeclared (first use in this function)
   35 |   else if( c == ’T’) return 4;
      |                  ^
main.c: In function 'insert':
main.c:56:63: error: stray '\342' in program
   56 |     if(A[ (h1(getKey(str)) + i * h2(getKey(str))) % N ][0] == <U+2019>\0<U+2019>){
      |                                                               ^~~~~~~~
main.c:56:64: error: stray '\' in program
   56 |     if(A[ (h1(getKey(str)) + i * h2(getKey(str))) % N ][0] == ’\0’){
      |                                                                ^
main.c:56:66: error: stray '\342' in program
   56 |     if(A[ (h1(getKey(str)) + i * h2(getKey(str))) % N ][0] == <U+2019>\0<U+2019>){
      |                                                                         ^~~~~~~~