제출 #921768

#제출 시각아이디문제언어결과실행 시간메모리
9217681075508020060209tcCake 3 (JOI19_cake3)C++14
0 / 100
1 ms2392 KiB
#pragma GCC optimize("O3") //#include "meetings.h" #include<bits/stdc++.h> using namespace std; #define int long long #define X first #define Y second #define SZ(x) (int)(x).size() int K; int ksum; multiset<int>tmst; multiset<int>bmst; void mINS(int v){ tmst.insert(v); ksum+=v; if(tmst.size()>K){ ksum-=*(tmst.begin()); bmst.insert(*tmst.begin()); tmst.erase(tmst.begin()); } } void mDEL(int v){ if(bmst.find(v)!=bmst.end()){ bmst.erase(bmst.find(v)); return; } ksum-=v; tmst.erase(tmst.find(v)); if(tmst.size()<K){ if(bmst.size()){ tmst.insert(*(bmst.rbegin())); ksum+=*bmst.rbegin(); bmst.erase(prev(bmst.end())); } } } int mlit;int mrit; int n; pair<int,int>ar[200005]; int ans[200005]; vector<pair<int,int>>targ;vector<pair<int,int>>tbrg; void solve(vector<pair<int,int>>arg,vector<pair<int,int>>brg){ vector<int>apt; for(int i=0;i<arg.size();i++){ apt.push_back((arg[i].first+arg[i].second)/2); } } signed main(){ cin>>n>>K; for(int i=1;i<=n;i++){ cin>>ar[i].second>>ar[i].first; ar[i].first*=2; } K-=2; sort(ar+1,ar+n+1); }

컴파일 시 표준 에러 (stderr) 메시지

cake3.cpp: In function 'void mINS(long long int)':
cake3.cpp:16:15: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   16 | if(tmst.size()>K){
      |    ~~~~~~~~~~~^~
cake3.cpp: In function 'void mDEL(long long int)':
cake3.cpp:29:15: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   29 | if(tmst.size()<K){
      |    ~~~~~~~~~~~^~
cake3.cpp: In function 'void solve(std::vector<std::pair<long long int, long long int> >, std::vector<std::pair<long long int, long long int> >)':
cake3.cpp:48:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   48 | for(int i=0;i<arg.size();i++){
      |             ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...