# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1158941 | 2025-02-27 21:29:54 | PagodePaiva | 통행료 (IOI18_highway) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "highway.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll N = 90010;
vector <pair <ll, ll>> g[N];
pair <ll, ll> especial;
vector <ll> query;
pair <ll, ll> pai[N];
ll h[N];
ll t1;
vector <array <ll, 3>> arestas;
void dfs(ll v, ll p){
for(auto [x, idx] : g[v]){
if(x == p) continue;
query[idx] = 1;
dfs(x, v);
}
return;
}
void dfs2(ll v, ll p){
for(auto [x, idx] : g[v]){
if(x == p) continue;
h[x] = h[v]+1;
pai[x] = {v, idx};
if(h[x] == t1) arestas.push_back({x, v, idx});
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
컴파일 시 표준 에러 (stderr) 메시지
highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)': highway.cpp:46:16: error: invalid initialization of reference of type 'const std::vector<int>&' from expression of type 'std::vector<long long int>' 46 | ll h = ask(query)/A; | ^~~~~ In file included from highway.cpp:1: highway.h:7:39: note: in passing argument 1 of 'long long int ask(const std::vector<int>&)' 7 | long long ask(const std::vector<int> &w); | ~~~~~~~~~~~~~~~~~~~~~~~~^ highway.cpp:53:20: error: invalid initialization of reference of type 'const std::vector<int>&' from expression of type 'std::vector<long long int>' 53 | ll t = ask(query); | ^~~~~ In file included from highway.cpp:1: highway.h:7:39: note: in passing argument 1 of 'long long int ask(const std::vector<int>&)' 7 | long long ask(const std::vector<int> &w); | ~~~~~~~~~~~~~~~~~~~~~~~~^ highway.cpp:67:16: error: invalid initialization of reference of type 'const std::vector<int>&' from expression of type 'std::vector<long long int>' 67 | ll S = ask(query); | ^~~~~ In file included from highway.cpp:1: highway.h:7:39: note: in passing argument 1 of 'long long int ask(const std::vector<int>&)' 7 | long long ask(const std::vector<int> &w); | ~~~~~~~~~~~~~~~~~~~~~~~~^ highway.cpp:3:12: error: 'long long long' is too long for GCC 3 | #define ll long long | ^~~~ highway.cpp:70:8: note: in expansion of macro 'll' 70 | ll ll = l; | ^~ highway.cpp:3:17: error: 'long long long' is too long for GCC 3 | #define ll long long | ^~~~ highway.cpp:70:8: note: in expansion of macro 'll' 70 | ll ll = l; | ^~ highway.cpp:70:11: error: expected unqualified-id before '=' token 70 | ll ll = l; | ^ highway.cpp:3:12: error: expected primary-expression before 'long' 3 | #define ll long long | ^~~~ highway.cpp:75:36: note: in expansion of macro 'll' 75 | if(t1 == 0) resposta.first = u[ll]; | ^~ highway.cpp:75:36: error: expected ']' before 'long' 75 | if(t1 == 0) resposta.first = u[ll]; | ^ | ] highway.cpp:3:12: error: expected primary-expression before 'long' 3 | #define ll long long | ^~~~ highway.cpp:77:16: note: in expansion of macro 'll' 77 | dfs2(u[ll], v[ll]); | ^~ highway.cpp:77:16: error: expected ']' before 'long' 77 | dfs2(u[ll], v[ll]); | ^ | ] highway.cpp:88:24: error: invalid initialization of reference of type 'const std::vector<int>&' from expression of type 'std::vector<long long int>' 88 | ll t = ask(query); | ^~~~~ In file included from highway.cpp:1: highway.h:7:39: note: in passing argument 1 of 'long long int ask(const std::vector<int>&)' 7 | long long ask(const std::vector<int> &w); | ~~~~~~~~~~~~~~~~~~~~~~~~^ highway.cpp:3:12: error: expected primary-expression before 'long' 3 | #define ll long long | ^~~~ highway.cpp:105:12: note: in expansion of macro 'll' 105 | swap(u[ll], v[ll]); | ^~ highway.cpp:105:12: error: expected ']' before 'long' 105 | swap(u[ll], v[ll]); | ^ | ] highway.cpp:3:12: error: expected primary-expression before 'long' 3 | #define ll long long | ^~~~ highway.cpp:107:37: note: in expansion of macro 'll' 107 | if(t1 == 0) resposta.second = u[ll]; | ^~ highway.cpp:107:37: error: expected ']' before 'long' 107 | if(t1 == 0) resposta.second = u[ll]; | ^ | ] highway.cpp:3:12: error: expected primary-expression before 'long' 3 | #define ll long long | ^~~~ highway.cpp:109:16: note: in expansion of macro 'll' 109 | dfs2(u[ll], v[ll]); | ^~ highway.cpp:109:16: error: expected ']' before 'long' 109 | dfs2(u[ll], v[ll]); | ^ | ] highway.cpp:116:24: error: invalid initialization of reference of type 'const std::vector<int>&' from expression of type 'std::vector<long long int>' 116 | ll t = ask(query); | ^~~~~ In file included from highway.cpp:1: highway.h:7:39: note: in passing argument 1 of 'long long int ask(const std::vector<int>&)' 7 | long long ask(const std::vector<int> &w); | ~~~~~~~~~~~~~~~~~~~~~~~~^