/ SeriousOJ /

Record Detail

Accepted


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

Code

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

#define pb      push_back
#define debug   cout<<"check"<<endl;cout.flush();
#define all(x)  (x).begin(),(x).end()
#define endl    '\n'

const ll N=200005;
const ll mod=1000000007;
const ll INF=2e18L+5;

void solve(){
    ll n;
    cin>>n;
    map<string,int>mp;
    for(ll i=0;i<n;i++){
        string st;cin>>st;
        mp[st]=0;
    }
    ll q;
    cin>>q;
    while(q--){
        string st;
        cin>>st;
        if(mp.find(st)==mp.end()){
            cout<<"Sorry, not on the list."<<endl;
        }
        else if(mp[st]==0){
            mp[st]=1;
            cout<<"Welcome!"<<endl;
        }
        else{
            cout<<"Already inside!"<<endl;
        }
    }
}

int32_t main(){  
    
    ios::sync_with_stdio(false);cin.tie(nullptr);
    
    int t=1;
    //cin>>t;
    for(int i=1;i<=t;i++){
        solve();
    }
    
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1227 LUCC Party Check-in
Contest
LUCC Presents Intra LU Junior Programming Contest - Replay
Language
C++17 (G++ 13.2.0)
Submit At
2025-09-02 15:36:17
Judged At
2025-09-02 15:38:54
Judged By
Score
100
Total Time
1ms
Peak Memory
532.0 KiB