# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
472867 |
2021-09-14T12:27:34 Z |
Mr_Ph |
Deda (COCI17_deda) |
C++14 |
|
1000 ms |
1368 KB |
///made by : Mr_Ph :D
#include<bits/stdc++.h>
#include<unordered_map>
typedef long long ll;
typedef long long int lli;
typedef unsigned long long ull;
using namespace std;
const double PI=acos(-1.0);
const ll mod=(ll)1e9+7;
//int dx[4] = {0, 0, 1, -1};
//int dy[4] = {1, -1, 0, 0};
///the defines :)
#define endl '\n'
#define vi vector<int>
#define vll vector<ll>
#define lower(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define upper(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define ent(arr) for(int i=0;i<arr.size();i++)cin>>arr[i];
#define all(arr) arr.begin(),arr.end()
#define allr(arr) arr.rbegin(),arr.rend()
#define sz size()
///the end of the defines ;)
void solve()
{
int n,m;
cin>>n>>m;
vector<pair<int,int>>mp;
for(int i=0;i<m;i++)
{
char x;
cin>>x;
if(x=='M')
{
int a,b;
cin>>a>>b;
mp.push_back({a,b});
}
else
{
int a,b;
cin>>a>>b;
int done=INT_MAX;
for(auto i:mp)
{
if(i.first<=a&&i.second>=b)
done=min(done,i.second);
}
if(done==INT_MAX)
cout<<-1<<endl;
else
cout<<done<<endl;
}
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(0);
//freopen("window.in","r",stdin);
//freopen("output.txt","w",stdout);
int t=1;//int st;
//cin>>t;//cin>>st;
while(t--)
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
8 ms |
344 KB |
Output is correct |
4 |
Correct |
187 ms |
1368 KB |
Output is correct |
5 |
Execution timed out |
1086 ms |
864 KB |
Time limit exceeded |
6 |
Execution timed out |
1092 ms |
860 KB |
Time limit exceeded |
7 |
Execution timed out |
1089 ms |
832 KB |
Time limit exceeded |