Create 100819N.cpp

This commit is contained in:
Kirigaya Kazuto 2016-08-13 17:14:13 +08:00 committed by GitHub
parent f386cf069c
commit 412bf70019

View File

@ -0,0 +1,28 @@
#include <iostream>
#include <string>
using namespace std;
string str;
int main()
{
int n,k;
cin>>n>>k;
int x=1;//safe
int y=k;//break
for(int i=0;i<n;i++)
{
int t;
cin>>t>>str;
if(str.at(0)=='B')
{
if(t<y) y=t;
}
else
{
if(t>x) x=t;
}
}
cout<<x+1<<" "<<y-1<<endl;
return 0;
}