제출 #1062612

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10626122024-08-17 09:06:13UnforgettableplPort Facility (JOI17_port_facility)C++98
22 / 100
1524 ms1048576 KiB
#include <bits/stdc++.h>
using namespace std;
// #define int long long
const long long modulo = 1e9+7;
const int LIMIT = 1e9;
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
vector<pair<int,int>> ships(N);
for(auto&[a,b]:ships)cin>>a>>b;
vector<forward_list<int>> adj(N);
sort(ships.begin(), ships.end());
int edges_added = 0;
set<pair<int,int>> active;
for(int i=0;i<N;i++) {
auto [a,b] = ships[i];
while(!active.empty() and active.begin()->first<a)active.erase(active.begin());
auto final = active.emplace(b,i).first;
for(auto iter=active.begin();iter!=final;++iter) {
edges_added++;
adj[i].emplace_front(iter->second);
adj[iter->second].emplace_front(i);
}
if(edges_added>LIMIT) {
cout << "0\n";
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

port_facility.cpp: In function 'int32_t main()':
port_facility.cpp:15:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   15 |     for(auto&[a,b]:ships)cin>>a>>b;
      |              ^
port_facility.cpp:21:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   21 |         auto [a,b] = ships[i];
      |              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...