답안 #472853

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
472853 2021-09-14T12:06:56 Z Ahmed57 Deda (COCI17_deda) C++14
80 / 140
1000 ms 4768 KB
#include<bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n,m;
    cin>>n>>m;
    vector<pair<long long,long long>> v;
    for(int i = 0;i<m;i++){
        char x;long long a,b;
        cin>>x>>a>>b;
        if(x=='M'){
            v.push_back({a,b});
        }else{
            long long ans = 1e18;
            for(int j = 0;j<v.size();j++){
                if(v[j].second>=b&&v[j].first<=a){
                    ans = min(ans,v[j].second);
                }
            }
            if(ans==1e18){
                cout<<-1<<"\n";
            }else cout<<ans<<"\n";
        }
    }
	return 0;
}

Compilation message

deda.cpp: In function 'int main()':
deda.cpp:17:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |             for(int j = 0;j<v.size();j++){
      |                           ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 10 ms 416 KB Output is correct
4 Correct 215 ms 4768 KB Output is correct
5 Execution timed out 1037 ms 2008 KB Time limit exceeded
6 Execution timed out 1084 ms 1964 KB Time limit exceeded
7 Execution timed out 1092 ms 1908 KB Time limit exceeded