Wrong Answer
Code
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define endl "\n"
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin>>n;
vector<string> v;
for(int i=0; i<n; i++)
{
string y;
cin>>y;
v.push_back(y);
}
int m;
cin>>m;
for(int i=0; i<m; i++)
{
string x;
cin>>x;
bool flag =0;
for(int j=0; j<n; j++)
{
if(x==v[j])
{
flag =1;
}
}
vector<string> p(0);
if(flag==1)
{
bool here =0;
for(string yx:p){
if(yx==x){
here =1;
}
}
p.push_back(x);
if(here)
{
cout << "Already inside!"<< endl;
}
else
{
cout << "Welcome!"<< endl;
}
}
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:38:52
- Judged At
- 2025-09-01 07:38:52
- Judged By
- Score
- 0
- Total Time
- 1ms
- Peak Memory
- 368.0 KiB