Accepted
Code
#include <iostream>
using namespace std;
int main() {
int a,b;
cin>>a;
string arr1[a];
for (int i=0; i<a; i++) {
cin>>arr1[i];
}
cin>>b;
string arr2[b];
for (int i=0; i<b; i++) {
cin>>arr2[i];
}
string welcomed[b];
int welcomedCount =0;
for (int j=0; j<b; j++) {
bool isOnList= false;
bool alreadyWelcomed=false;
for (int i=0; i<a; i++) {
if (arr2[j] == arr1[i]) {
isOnList= true;
break;
}
}
for (int k=0; k<welcomedCount; k++) {
if (arr2[j] == welcomed[k]) {
alreadyWelcomed= true;
break;
}
}
if (isOnList) {
if (alreadyWelcomed) {
cout<<"Already inside!"<<endl;
}
else {
cout<<"Welcome!"<<endl;
welcomed[welcomedCount++]=arr2[j];
}
}
else {
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++17 (G++ 13.2.0)
- Submit At
- 2025-09-01 07:23:50
- Judged At
- 2025-09-01 07:23:50
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 536.0 KiB