/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 1ms 532.0 KiB
#4 Accepted 2ms 532.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
int main(){
    long long n, m;
    cin >> n;
    string s[n];
    for(int i = 0; i < n; i++){
        cin >> s[i];
    }
    cin >> m;
    string check[m];
    int t[m];
    for(int i = 0; i < m; i++){
        cin >> check[i];
        t[i] = 0;
    }
    for(int i = 0; i < m; i++){
        int flag = 0;
        for(int j = 0; j < n; j++){
            if(check[i] == s[j]){
                for(int k = 0; k < m; k++){
                    if(check[i] == check[k] && t[k] == 0){
                        cout << "Welcome!" << endl;
                        t[k] = 1;
                        flag = 1;
                        break;
                    }
                    else if(check[i] == check[k] && t[k] == 1){
                        cout << "Already inside!" << endl;
                        flag = 1;
                        break;
                    }
                }
            }
        }
        if(flag == 0){
            cout << "Sorry, not on the list." << endl;
        }
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1227 LUCC Party Check-in
Contest
LUCC Presents Intra LU Junior Programming Contest - Replay
Language
C++11 (G++ 13.2.0)
Submit At
2025-09-02 16:23:06
Judged At
2025-09-02 16:23:06
Judged By
Score
100
Total Time
2ms
Peak Memory
532.0 KiB