제출 #97524

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
975242019-02-16 18:00:57Alexa2001이상적인 도시 (IOI12_city)C++17
100 / 100
277 ms22548 KiB
#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9, Nmax = 1e5 + 5;
typedef long long ll;
int n, x[Nmax], y[Nmax], w[Nmax];
vector<int> edge[Nmax], v[Nmax];
void dfs(int node, int dad = 0)
{
for(auto it : edge[node])
if(it != dad)
{
dfs(it, node);
w[node] += w[it];
w[node] %= Mod;
}
}
void add_edge(set< pair<int,int> > &Edges, int x, int y)
{
if(Edges.find({x, y}) != Edges.end()) return;
edge[x].push_back(y); edge[y].push_back(x);
Edges.insert({x, y});
}
int calc_dist() /// vertical
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

city.cpp: In function 'int calc_dist()':
city.cpp:44:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(j=0; j<v[i].size(); ++j)
                  ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...