답안 #89093

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
89093 2018-12-10T09:50:07 Z lazarus88 학교 설립 (IZhO13_school) C++14
5 / 100
2000 ms 21552 KB
#include<bits/stdc++.h>
using namespace  std;
int main(){
	int n,m,s,cnt=0;
	set <pair<int,int > > st,st1;
	cin>>n>>m>>s;
    int a[100001],b[100001];
	for(int  i=1;i<=n;i++){
       cin>>a[i]>>b[i];
       st.insert({-a[i],i});
       st1.insert({-b[i],i});
   }
   while(m>0){
   	pair<int,int> k=*st.begin();
   	st.erase(st.begin());
   	pair<int,int> t=*st.begin();
   	if(-k.first+b[t.second]>-t.first+b[k.second]){
   		cnt+=(-k.first);
   		st1.erase({-b[k.second],k.second});
	   }
	   else{
	   	st.erase(st.begin());
	   	st.insert(k);
	   	cnt+=(-t.first);
	   	st1.erase({-b[t.second],t.second});
	   }
	   m--;
   }
   while(s>0){
   	pair<int,int > k=*st1.begin();
   	
   	st1.erase(st1.begin());
   	cnt+=(-k.first);
   	s--;
   }
      cout<<cnt;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Execution timed out 2009 ms 372 KB Time limit exceeded
3 Correct 2 ms 372 KB Output is correct
4 Incorrect 3 ms 408 KB Output isn't correct
5 Incorrect 2 ms 464 KB Output isn't correct
6 Incorrect 2 ms 540 KB Output isn't correct
7 Incorrect 8 ms 972 KB Output isn't correct
8 Incorrect 9 ms 972 KB Output isn't correct
9 Incorrect 9 ms 972 KB Output isn't correct
10 Incorrect 11 ms 976 KB Output isn't correct
11 Incorrect 9 ms 1104 KB Output isn't correct
12 Incorrect 8 ms 1104 KB Output isn't correct
13 Incorrect 89 ms 4260 KB Output isn't correct
14 Incorrect 206 ms 8492 KB Output isn't correct
15 Runtime error 254 ms 21356 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 271 ms 21448 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 221 ms 21448 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 211 ms 21500 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 220 ms 21500 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 208 ms 21552 KB Execution killed with signal 11 (could be triggered by violating memory limits)