/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 0ms 284.0 KiB
#2 Wrong Answer 0ms 284.0 KiB

Code

#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#define MAX_NAME_LEN 21
#define MAX_GUESTS 100

typedef struct {
    char name[MAX_NAME_LEN];
    int entered;
}
Guest;

Guest guest_list[MAX_GUESTS];
int num_guests;

int main() {
    scanf("%d", & num_guests);
    for (int i = 0; i < num_guests; i++) {
        scanf("%s", guest_list[i].name);
        guest_list[i].entered = 0;
    }

    int num_arrivals;
    scanf("%d", & num_arrivals);
    char arrival_name[MAX_NAME_LEN];
    for (int i = 0; i < num_arrivals; i++) {
        scanf("%s", arrival_name);
        int found = 0;
        for (int j = 0; j < num_guests; j++) {
            if (strcmp(arrival_name, guest_list[j].name) == 0) {
                found = 1;
                if(guest_list[j].entered == 0) {
                    printf("Welcome!\n");
                    guest_list[j].entered = 1;
                } else {
                    printf("Already inside!\n");
                }
                
            }

        }

        if (!found) {
            printf("Sorry,not on the list.\n");
        }
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1227 LUCC Party Check-in
Contest
LUCC Presents Intra LU Junior Programming Contest - Replay
Language
C99 (GCC 13.2.0)
Submit At
2025-09-02 17:38:50
Judged At
2025-09-02 17:38:50
Judged By
Score
0
Total Time
0ms
Peak Memory
284.0 KiB