# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
897620 | 2024-01-03T13:42:25 Z | ttamx | Meetings (JOI19_meetings) | C++14 | 39 ms | 600 KB |
#include "meetings.h" #include<bits/stdc++.h> using namespace std; void Solve(int n){ mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); vector<vector<int>> comp(n); for(int i=1;i<n;i++)comp[0].emplace_back(i); function<void(int)> dnc=[&](int s){ int sz=comp[s].size(); if(!sz)return; vector<int> res,path{s}; swap(res,comp[s]); int t=res[rng()%sz]; for(auto u:res)if(u!=t){ int v=Query(s,t,u); if(u==v)path.emplace_back(u); else comp[v].emplace_back(u); } sort(path.begin()+1,path.end(),[&](int l,int r){ return Query(s,l,r)==l; }); path.emplace_back(t); for(int i=1;i<path.size();i++)Bridge(path[i-1],path[i]); for(auto u:path)dnc(u); }; dnc(0); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong Answer [3] |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong Answer [3] |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong Answer [3] |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 39 ms | 600 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |