| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 164887 | DavidDamian | Tropical Garden (IOI11_garden) | C++11 | 5 ms | 1116 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "garden.h"
#include "gardenlib.h"
#include<bits/stdc++.h>
using namespace std;
void answer(int x);
struct edge
{
int from,to;
int w;
};
bool operator<(const edge e1,const edge e2)
{
if(e1.w>e2.w) return true;
else return false;
}
vector <edge> adjList[1005];
int routes[1005][105];
void make_route(int u)
{
int last_taken=-1;
int v=u;
for(int i=0;i<101;i++){
routes[u][i]=v;
if(adjList[v][0].w!=last_taken || adjList[v].size()==1){
last_taken=adjList[v][0].w;
v=adjList[v][0].to;
}
else{
last_taken=adjList[v][1].w;
v=adjList[v][1].to;
}
}
}
void count_routes(int N, int M, int P, int R[][2], int Q, int G[])
{
if(N>1000) return;
for(int i=0;i<M;i++){
int u=R[i][0];
int v=R[i][1];
edge e={u,v,M-i};
adjList[u].push_back(e);
swap(e.from,e.to);
adjList[v].push_back(e);
}
for(int u=0;u<N;u++){
int x=adjList[u].size();
sort(adjList[u].begin(),adjList[u].end());
}
for(int u=0;u<N;u++){
make_route(u);
}
int sum;
for(int i=0; i<Q; i++){
sum=0;
for(int u=0;u<N;u++){
if(routes[ u ][ G[i] ]==P) sum++;
}
answer(sum);
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
