/ SeriousOJ /

Record Detail

Accepted


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

Code

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    string s[n];
    for(int i = 0; i < n; i++){
        cin >> s[i];
    }
    int m;
    cin >> m;
    string c[m];
    int t[m];
    for(int i = 0; i < m; i++){
        cin >> c[i];
        t[i] = 0;
    }
    for(int i = 0; i < m; i++){
            int flag = 0;
            for(int j = 0; j < n; j++){
                if(c[i] == s[j]){
                    for(int k = 0; k < m; k++){
                        if(c[i] == c[k] && t[k] == 0){
                            cout << "Welcome!" << endl;
                            t[k] = 1;
                            flag = 1;
                            break;
                        }
                        else if(c[i] == c[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 Kick & Code Intra LU Programming Contest
Language
C++11 (G++ 13.2.0)
Submit At
2025-09-01 06:51:48
Judged At
2025-09-01 06:51:48
Judged By
Score
100
Total Time
2ms
Peak Memory
532.0 KiB