mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 100819N.cpp
This commit is contained in:
parent
f386cf069c
commit
412bf70019
28
Codeforces/Gym/100819N.cpp
Normal file
28
Codeforces/Gym/100819N.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user