Submission #1088826

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10888262024-09-15 09:17:52salmonHiring (IOI09_hiring)C++14
2 / 100
399 ms42304 KiB
#include <bits/stdc++.h>
using namespace std;
int N;
vector<pair<pair<long long int,long long int>,int>> v;
long long int W;
long long int h1,h2;
priority_queue<pair<long long int,int>,vector<pair<long long int,int>>,greater<pair<long long int,int>>> satprime;
priority_queue<pair<long long int,int>> sat;
vector<pair<pair<long long int, long long int>,int>> nov;
bool c(pair<pair<long long int, long long int>,int> ii1, pair<pair<long long int, long long int>,int> ii2){
return ii1.first.first * ii2.first.second < ii2.first.first * ii1.first.second;
}
int main(){
scanf(" %d",&N);
scanf(" %lld",&W);
for(int i = 0; i < N; i++){
scanf(" %lld",&h1);
scanf(" %lld",&h2);
v.push_back({{h1,h2},i});
}
sort(v.begin(),v.end(),c);
long long int sum = 0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

hiring.cpp: In function 'int main()':
hiring.cpp:40:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::priority_queue<std::pair<long long int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |             if(ans == sat.size() + 1){
      |                ~~~~^~~~~~~~~~~~~~~~~
hiring.cpp:18:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |     scanf(" %d",&N);
      |     ~~~~~^~~~~~~~~~
hiring.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |     scanf(" %lld",&W);
      |     ~~~~~^~~~~~~~~~~~
hiring.cpp:22:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |         scanf(" %lld",&h1);
      |         ~~~~~^~~~~~~~~~~~~
hiring.cpp:23:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |         scanf(" %lld",&h2);
      |         ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...