internal class Program
{
static void Main(string[] args)
{
StreamReader sr = new StreamReader(Console.OpenStandardInput());
StreamWriter sw = new StreamWriter(Console.OpenStandardOutput());
int n = int.Parse(sr.ReadLine());
SortedSet<string> workingPeople = new SortedSet<string>();
// 출입카드 로그
for (int i = 0; i < n; i++)
{
string[] s = sr.ReadLine().Split(" ");
if (s[1].Equals("enter"))
{
workingPeople.Add(s[0]);
}
else
{
workingPeople.Remove(s[0]);
}
}
// 회사에 남은 사람 역순 출력
foreach (string workingPerson in workingPeople.Reverse())
{
sw.WriteLine(workingPerson);
}
sr.Close();
sw.Close();
}
}
댓글남기기