제출 #108170

#제출 시각아이디문제언어결과실행 시간메모리
108170SecretAgent007콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "ricehub.h" using namespace std; #define int long long const int INF = 1e18; vector< int > pref; int calc(int left, int right, int B, int X[]){ int l = left, r = right; while(l < r){ int mid = (l+r+1)/2; int k = (l+mid)/2; int cost = X[k-1]*(k-left+1)-(pref[k]-pref[left-1])+(pref[mid]-pref[k])-(mid-k)*X[k-1]; if(cost > B){ r = mid-1; }else{ l = mid; } } return l-left+1; } int besthub(int R, int L, int X[], int B){ pref.resize(R+1); for(int i = 0; i < R; i++){ pref[i+1] += pref[i]; pref[i+1] += X[i]; } int ans = -INF; for(int i = 1; i <= R; i++){ ans = max(calc(i,R,B,X), ans); } return ans; } /* signed main(){ ios::sync_with_stdio(false); cin.tie(0); int r, l, b; cin >> r >> l >> b; int x[r]; for(int i = 0; i < r; i++) cin >> x[i]; cout << besthub(r,l,x,b) << endl; } */

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

combo.cpp:2:10: fatal error: ricehub.h: No such file or directory
    2 | #include "ricehub.h"
      |          ^~~~~~~~~~~
compilation terminated.