제출 #933605

#제출 시각아이디문제언어결과실행 시간메모리
933605vjudge1Speedrun (RMI21_speedrun)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include <speedrun.h> using namespace std; void assignHints (int subtask , int N, int A[], int B[]) { setHintLen(N-1); vector<int>adj(N+1); for (int i = 0; i < N; i++) { adj[A[i]]++; adj[B[i]]++; } for (int i = 0; i < N+1; i++) { if (adj[A[i]].size() == 1) setHint(i, 0, 0); else continue; } } void speedrun(int subtask , int N, int start ) { bool yo = getHint(0); int jefe; if (yo) { for (int i = 1; i < N+1; i++) { if (i == start) continue; if (!goTo(i)) continue; jefe = i; break; } } for (int i = 1; i <= N; i++) { if (i == jefe) continue; goTo(i); goTo(jefe); } }

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

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:16:17: error: request for member 'size' in 'adj.std::vector<int>::operator[](((std::vector<int>::size_type)(*(A + ((sizetype)(((long unsigned int)i) * 4))))))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   16 |   if (adj[A[i]].size() == 1)
      |                 ^~~~