제출 #1055929

#제출 시각아이디문제언어결과실행 시간메모리
1055929Muhammet도로 폐쇄 (APIO21_roads)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "roads.h" #include "grader.cpp" using namespace std; #define ll long long #define ff first #define ss second vector<ll> minimum_closure_costs(int n, vector<int> u, vector<int> u1, vector<int> w) { vector <pair<ll,pair<ll,ll>>> v; ll s = 0; for(int i = 0; i < n-1; i++){ v.push_back({w[i],{u[i],u1[i]}}); s += w[i]; } vector <ll> p(n), v1; sort(v.rbegin(), v.rend()); for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ p[j] = 0; } ll s1 = s; for(auto j : v){ if(p[j.ss.ff] < i and p[j.ss.ss] < i){ s1 -= j.ff; p[j.ss.ff]++; p[j.ss.ss]++; } } v1.push_back(s1); } return v1; }

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

/usr/bin/ld: /tmp/cchncbTH.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc4ymbbI.o:roads.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status