# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
14806 | gs14004 | 열대 식물원 (Tropical Garden) (IOI11_garden) | C++14 | 5055 ms | 46480 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "garden.h"
#include "gardenlib.h"
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
typedef pair<int,int> pi;
vector<pi> graph[150005];
int nxt[300005][30];
int low[150005];
void count_routes(int N, int M, int P, int R[][2], int Q, int G[])
{
memset(low,0x3f,sizeof(low));
for (int i=0; i<M; i++) {
for (int j=0; j<2; j++) {
low[R[i][j]] = min(low[R[i][j]],i);
}
graph[R[i][0]].push_back(pi(R[i][1],i));
graph[R[i][1]].push_back(pi(R[i][0],i));
}
for (int i=0; i<N; i++) {
if(low[graph[i][0].first] == graph[i][0].second){
nxt[2*i][0] = graph[i][0].first * 2 + 1;
}
else{
nxt[2*i][0] = graph[i][0].first * 2;
}
if(graph[i].size() == 1){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |