Problem:
Score : 100 points

Problem Statement

You are given three integers A, B and C.

Determine if there exists an equilateral triangle whose sides have lengths A, B and C.

Constraints

All values in input are integers.

1 \leq A,B,C \leq 100

Input

Input is given from Standard Input in the following format:

A B C

Output

If there exists an equilateral triangle whose sides have lengths A, B and C, print Yes; otherwise, print No.

Sample Input 1

2 2 2

Sample Output 1

Yes

There exists an equilateral triangle whose sides have lengths 2, 2 and 2.

Sample Input 2

3 4 5

Sample Output 2

No

There is no equilateral triangle whose sides have lengths 3, 4 and 5.

Solution in C (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<stdio.h>
// #define MAX 100002
void move_golems_right(int *golems, char *cells, int N, char target);
void move_golems_left(int *golems, char *cells, int N, char target);
int main(void){
    int N, Q;
    scanf("%d %d ", &N, &Q);

    char s[N];
    scanf("%s ", s);

    int golems[N];
    for(int i=0; i<N; i++){
        golems[i] = 1;
    }

    for(int i=0; i<Q; i++){
        char t, d;
        scanf("%c %c ", &t, &d);
        if(d == 'R'){
            move_golems_right(golems, s, N, t);
        }else{
            move_golems_left(golems, s, N, t);
        }
    }

    int sum = 0;
    for(int i=0; i<N; i++){
        sum += golems[i];
    }
    printf("%d\n", sum);
    return 0;
}

void move_golems_right(int *golems, char *cells, int N, char target){
    int increase_cells[N];
    for(int i=0; i<N; i++){
        increase_cells[i] = 0;
    }
    for(int i=0; i<N; i++){
        if(cells[i] == target){
            if(i != N-1){
                increase_cells[i+1] = golems[i];
            }
            golems[i] = 0;
        }
    }
    for(int i=0; i<N; i++){
        golems[i] += increase_cells[i];
    }
}

void move_golems_left(int *golems, char *cells, int N, char target){
    int increase_cells[N];
    for(int i=0; i<N; i++){
        increase_cells[i] = 0;
    }
    for(int i=0; i<N; i++){
        if(cells[i] == target){
            if(i != 0){
                increase_cells[i-1] = golems[i];
            }
            golems[i] = 0;
        }
    }
    for(int i=0; i<N; i++){
        golems[i] += increase_cells[i];
    }
}