/ 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;
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
int main()
{
    fast
    /*ll t;
    cin>>t;
    while(t--) solve*/

    int m, n;
    cin>>m;
    vector<string> g;
    int arr[m] = {0}, f;
    for (int i=0; i<m; i++) {
        string x;
        cin>>x;
        g.push_back(x);
    }
    cin>>n;
    vector<string> a;
    for (int i=0; i<n; i++){
        string s;
        cin>>s;
        a.push_back(s);
    }

    for (int i=0; i<n; i++){
        string p = a[i];
        f=0;
        for (int j=0; j<m; j++){
            if (p==g[j]){
                if (arr[j]==0){
                    f=1;
                    arr[j] = 1;
                    break;
                }
                else {
                    f=3;
                    break;
                }
            }
            else f=2;
        }

        if (f==1) cout<<"Welcome!"<<endl;
        else if (f==2) cout<<"Sorry, not on the list."<<endl;
        else if (f==3) cout<<"Already inside!"<<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++17 (G++ 13.2.0)
Submit At
2025-09-01 07:15:49
Judged At
2025-09-01 07:15:49
Judged By
Score
100
Total Time
2ms
Peak Memory
532.0 KiB