제출 #823325

#제출 시각아이디문제언어결과실행 시간메모리
823325Shithila전선 연결 (IOI17_wiring)C++14
컴파일 에러
0 ms0 KiB
#include<iostream> #include<functional> using namespace std; int main() { int n; cin>>n; for(int i=0;i<n;i++) { int x; int y; int r; int s; int w; cin>>r>>s>>x>>y>>w; function<int(int,int)> dfs = [&](int pos,int val){ if(val==x) { int tans=1; for(int i=pos;i<y;i++) { tans=tans*s; } return tans; } if(pos==y) {return 0;} return ((s-r+1)*dfs(pos+1,val+1))+(dfs(pos+1,val)*(r-1)); }; int ans=dfs(0,0); int ss=1; for(int i=0;i<y;i++) { ss=ss*s; //cout<<ss<<endl; } //cout<<ss; if((ans*w)>(ss)) { cout<<"yes"<<endl; } else cout<<"no"<<endl; } }

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

/usr/bin/ld: /tmp/cc66OLf9.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccmFrtnc.o:wiring.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc66OLf9.o: in function `main':
grader.cpp:(.text.startup+0x22a): undefined reference to `min_total_length(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status