제출 #566143

#제출 시각아이디문제언어결과실행 시간메모리
566143UzoufXylophone (JOI18_xylophone)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include "xylophone.h" using namespace std; using namespace __gnu_pbds; #define int long long #define endl "\n" int mod=1e9+7; int N=2e5+5; template<class x> using ordered_multiset = tree<x, null_type,less_equal<x>, rb_tree_tag,tree_order_statistics_node_update>; bool sign[5005]; void solve(int N) { map<pair<int,int>,int> df; for (int i=1;i<=N;i++) { if (i+1<=N) { df[{i,i+1}]=query(i,i+1); } if (i+2<=N) { df[{i,i+2}]=query(i,i+2); } } for (int i=1;i<=N;i++) { if (df[{i,i+2}]==df[{i,i+1}]+df[{i+1,i+2}]) { sign[i]=true; sign[i+1]=true; i++; continue; } sign[i]=1^sign[i-1]; } int og[N+5]; og[1]=0; int mn=INT_MAX; for (int i=2;i<=N;i++) { if (sign[i-1]==0) { og[i]=og[i-1]+df[{i-1,i}]; } else { og[i]=og[i-1]-df[{i-1,i}]; } mn=min(mn,og[i]); } mn*=-1; int ans[N+5]; bool f1=false,gg=false; for (int i=1;i<=N;i++) { ans[i]=og[i]+mn+1; if (ans[i]==1) f1=true; if (ans[i]==N && !f1) gg=true; } for (int i=1;i<=N;i++) { if (gg) ans[i]=N+1-ans[i]; answer(i,ans[i]); } }

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

/usr/bin/ld: /tmp/cc1ThPlI.o: in function `main':
grader.cpp:(.text.startup+0x30): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status