제출 #495290

#제출 시각아이디문제언어결과실행 시간메모리
495290White거래 (IZhO13_trading)C++14
100 / 100
478 ms30800 KiB
#pragma GCC optimize("O3") #include<bits/stdc++.h> #define endl "\n" using namespace std; multiset<long long>a; vector<long long>L[300001],R[300001]; int main(){ long long n,m,l,r,x; cin>>n>>m; for(long long i=0;i<m;i++){ cin>>l>>r>>x; l--;r--; L[l].push_back(x-l); R[r].push_back(x-l); } for(long long i=0;i<n;i++){ for(long long j=0;j<L[i].size();j++){ a.insert(L[i][j]); } if(a.empty()==true){ cout<<"0 "; }else{ multiset<long long>::iterator it=a.end(); it--; cout<<*it+i<<" "; } for(long long j=0;j<R[i].size();j++){ a.erase(a.find(R[i][j])); } } cout<<endl; return 0; }

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

trading.cpp: In function 'int main()':
trading.cpp:22:28: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |         for(long long j=0;j<L[i].size();j++){
      |                           ~^~~~~~~~~~~~
trading.cpp:32:28: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |         for(long long j=0;j<R[i].size();j++){
      |                           ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...