towns.cpp: In function 'void solve(int, int, std::vector<std::pair<int, int> >)':
towns.cpp:80:20: warning: declaration of 'seg' shadows a previous local [-Wshadow]
80 | vector <pii> nw, seg;
| ^~~
towns.cpp:74:25: note: shadowed declaration is here
74 | vector <vector <pii> > seg;
| ^~~
towns.cpp:22:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
22 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
92 | FOR(0, i, seg.size()) seg[i].s -= mn;
| ~~~~~~~~~~~~~
towns.cpp:92:3: note: in expansion of macro 'FOR'
92 | FOR(0, i, seg.size()) seg[i].s -= mn;
| ^~~
towns.cpp: In function 'void dfs2(int, int)':
towns.cpp:22:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
22 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
127 | FOR(1, i, edge[v].size())
| ~~~~~~~~~~~~~~~~~
towns.cpp:127:2: note: in expansion of macro 'FOR'
127 | FOR(1, i, edge[v].size())
| ^~~
towns.cpp:22:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
22 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
140 | FOR(0, i, edge[v].size())
| ~~~~~~~~~~~~~~~~~
towns.cpp:140:2: note: in expansion of macro 'FOR'
140 | FOR(0, i, edge[v].size())
| ^~~
towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:150:21: warning: declaration of 'n' shadows a global declaration [-Wshadow]
150 | int hubDistance(int n, int sub)
| ~~~~^
towns.cpp:43:5: note: shadowed declaration is here
43 | int n, have, dist[500][500], cnt;
| ^
towns.cpp:206:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
206 | return res * (have ? 1 : -1);
| ~~~~^~~~~~~~~~~~~~~~~
towns.cpp:150:28: warning: unused parameter 'sub' [-Wunused-parameter]
150 | int hubDistance(int n, int sub)
| ~~~~^~~
towns.cpp: In function 'void ini_query(int, int)':
towns.cpp:224:20: warning: declaration of 'n' shadows a global declaration [-Wshadow]
224 | void ini_query(int n, int k) {
| ~~~~^
towns.cpp:43:5: note: shadowed declaration is here
43 | int n, have, dist[500][500], cnt;
| ^
towns.cpp: In function 'int main()':
towns.cpp:254:17: warning: declaration of 'N' shadows a global declaration [-Wshadow]
254 | int ncase, R, N;
| ^
towns.cpp:218:12: note: shadowed declaration is here
218 | static int N;
| ^
towns.cpp:256:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
256 | scanf("%d%d", &subtask, &ncase);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
towns.cpp:258:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
258 | scanf("%d", &N);
| ~~~~~^~~~~~~~~~
towns.cpp: At global scope:
towns.cpp:221:12: warning: 'pid' defined but not used [-Wunused-variable]
221 | static int pid;
| ^~~
/usr/bin/ld: /tmp/ccO4crBe.o: in function `getDistance(int, int)':
grader.c:(.text+0x110): multiple definition of `getDistance(int, int)'; /tmp/ccV7Bmtf.o:towns.cpp:(.text+0x260): first defined here
/usr/bin/ld: /tmp/ccO4crBe.o: in function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'; /tmp/ccV7Bmtf.o:towns.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status