답안 #361735

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
361735 2021-01-31T12:51:12 Z David_M 꿈 (IOI13_dreaming) C++14
0 / 100
63 ms 16108 KB
#include "dreaming.h"
#include<bits/stdc++.h>
using namespace std;
int d[3][1<<17],f[1<<17],W[1<<17],w,e,D,X,Y,Z;
vector<pair<int,int> >v[1<<17];
void U(int x,int o){
	f[x]++;
	if(o<2&&d[o][x]>=D)e=x,D=d[o][x];
	if(o>1)D=min(D,max(d[1][x],d[2][x]));
	for(auto y:v[x])if(f[y.first]<=o)d[o][y.first]=d[o][x]+y.second,U(y.first,o);
}
int travelTime(int N,int M,int L,int A[],int B[],int T[]){
    while(M--)v[A[M]].push_back({B[M],T[M]}),v[B[M]].push_back({A[M],T[M]});
    while(N--)if(!f[N])U(N,0),U(e,1),U(e,2),W[w++]=D,D=0;
    while(w--){
        if(Z<W[w])Z=W[w];
        if(Y<W[w])Z=Y,Y=W[w];
        if(X<W[w])Y=X,X=W[w];
    }
return max(X,Z+(!!Z)*L)+Y+(!!Y)*L;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 63 ms 16108 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 3436 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 63 ms 16108 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 7660 KB Output is correct
2 Correct 26 ms 7532 KB Output is correct
3 Correct 30 ms 7532 KB Output is correct
4 Correct 35 ms 7532 KB Output is correct
5 Correct 26 ms 7532 KB Output is correct
6 Correct 30 ms 7788 KB Output is correct
7 Correct 30 ms 7788 KB Output is correct
8 Correct 25 ms 7532 KB Output is correct
9 Correct 27 ms 7404 KB Output is correct
10 Correct 27 ms 7680 KB Output is correct
11 Correct 3 ms 3436 KB Output is correct
12 Correct 6 ms 5228 KB Output is correct
13 Correct 7 ms 5296 KB Output is correct
14 Correct 6 ms 5228 KB Output is correct
15 Correct 6 ms 5228 KB Output is correct
16 Correct 6 ms 5100 KB Output is correct
17 Correct 6 ms 4588 KB Output is correct
18 Correct 7 ms 5356 KB Output is correct
19 Correct 6 ms 5228 KB Output is correct
20 Correct 2 ms 3436 KB Output is correct
21 Incorrect 3 ms 3436 KB Output isn't correct
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 3436 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 63 ms 16108 KB Output isn't correct
2 Halted 0 ms 0 KB -