# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
862657 | mraron | Bitaro’s Party (JOI18_bitaro) | C++14 | 3 ms | 9560 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int MAXN=100001;
int n,m,q;
vector<int> adj[MAXN];
vector<int> badj[MAXN];
const int blksz=333;
vector<pair<int,int>> best[MAXN];
int vis[MAXN], indeg[MAXN], volt[MAXN];
void dfs(int x) {
vis[x]=1;
for(auto& i:best[x]) i.first++;
best[x].push_back({0, x});
if(best[x].size()>blksz) best[x].resize(blksz);
for(int i:adj[x]) {
indeg[i]--;
vector<pair<int,int>> res;
res.resize(best[x].size()+best[i].size());
merge(best[i].begin(), best[i].end(), best[x].begin(), best[x].end(), res.begin(), [&](auto& x, auto& y) -> bool {
return x>y;
});
best[i].clear();
for(auto& j:res) {
if(volt[j.second]!=x) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |