/ 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 1ms 532.0 KiB

Code

/* --- "Start your journey in the name of God." --- */
/* ----- Amit Bhowmik ----- */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using int128 = __int128;
using ull = unsigned long long;
using u32 = unsigned;
const ll mod = 1e9 + 7;
const ll mx = 1e7 + 123;
typedef vector<ll> vl;
#define nl '\n';
typedef long double ld;
#define PB push_back
#define F first
#define S second
#define sz(x) x.size()
#define mid(l,r) ((r+l)/2)
const double PI = acos(-1);
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sqr(a) ((a) * (a))
#define YES cout << "YES" << nl;
#define NO cout << "NO" << nl;
#define lowerstr(x) transform(all(x),x.begin(), ::tolower)
#define upperstr(x) transform(all(x),x.begin(), ::toupper)

void solve() {
    ll m;
    cin >> m;
    unordered_set<string> str;
    string name;
    for (ll i = 0; i < m; i++) {
        cin >> name;
        str.insert(name);
    }

    ll n; cin >> n;
    unordered_set<string> st;
    for (ll i = 0; i < n; i++) {
        cin >> name;
        if (str.find(name) == str.end()) {
            cout << "Sorry, not on the list." << nl;
        }
        else if (st.find(name) == st.end()) {
            st.insert(name);
            cout << "Welcome!" << nl;
        } else {
            cout << "Already inside!" << nl;
        }
    }
    return;
}
int main() {
    // fast_io;
    // ll t; cin >> t;
    // while(t--)
    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:44:39
Judged At
2025-09-02 15:44:39
Judged By
Score
100
Total Time
1ms
Peak Memory
532.0 KiB