제출 #344023

#제출 시각아이디문제언어결과실행 시간메모리
344023tengiz05Library (JOI18_library)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "library.h" #include "grader.cpp" using namespace std; void Solve(int n){ vector<vector<int>> v(n); for(int i=0;i<n;i++){ vector<int> ask(n, 0); ask[i] = 1; for(int j=i+1;j<n;j++){ ask[j] = 1; if(Query(ask) == 1)v[i].push_back(j), v[j].push_back(i); ask[j] = 0; } } for(int i=0;i<n;i++){for(auto x : v[i])cout << x << ' ';cout << '\n';} vector<bool> used(n); vector<int> ans; int u=-1; for(int i=0;i<n;i++){ if(v[i].size() == 1){ u = i;break; } } assert(u != -1); while(true){ bool ch = false; used[u] = true; ans.push_back(u+1); for(auto to : v[u]){ if(!used[to]){ ch=true; u=to; } }if(!ch)break; } Answer(ans); return; } /* 5 4 2 5 3 1 */

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

/tmp/ccrzrKaR.o: In function `Query(std::vector<int, std::allocator<int> > const&)':
library.cpp:(.text+0x0): multiple definition of `Query(std::vector<int, std::allocator<int> > const&)'
/tmp/ccX5mayW.o:grader.cpp:(.text+0x0): first defined here
/tmp/ccrzrKaR.o:(.bss+0x0): multiple definition of `__my_judge_::judge'
/tmp/ccX5mayW.o:(.bss+0x0): first defined here
/tmp/ccrzrKaR.o: In function `Answer(std::vector<int, std::allocator<int> > const&)':
library.cpp:(.text+0x10): multiple definition of `Answer(std::vector<int, std::allocator<int> > const&)'
/tmp/ccX5mayW.o:grader.cpp:(.text+0x390): first defined here
/tmp/ccrzrKaR.o: In function `main':
library.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccX5mayW.o:grader.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status