Submission #861214

#TimeUsernameProblemLanguageResultExecution timeMemory
861214nasir_bashirovRice Hub (IOI11_ricehub)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define db long double #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vl vector<ll> #define vii vector<pii> #define vll vector<pll> #define endl '\n' #define all(x) x.begin(), x.end() #define fastio\ ios_base::sync_with_stdio(0);\ cin.tie(0);\ cout.tie(0)\ const int sz = 1e5 + 5; int n, m, c, a[sz], pre[sz]; signed main(){ cin >> n >> m >> c; for(int i = 1; i <= n; i++){ cin >> a[i]; pre[i] = pre[i - 1] + a[i]; } int l = 1, r = n, res = 0; while(l <= r){ int mid = (l + r) / 2, f = 0; for(int i = 1; i <= n; i++){ if(i + mid - 1 > n) break; int midd = (i + i + mid - 1) / 2; int cost = -(pre[midd] - pre[i - 1]) + a[midd] * (midd - i + 1) + (pre[i + mid - 1] - pre[midd]) - (i + mid - 1 - midd) * a[midd]; if(cost <= c){ f = 1; } } if(f){ res = mid; l = mid + 1; } else{ r = mid - 1; } } cout << res; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc1WMDM2.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccB0som0.o:ricehub.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc1WMDM2.o: in function `main':
grader.cpp:(.text.startup+0xae): undefined reference to `besthub(int, int, int*, long long)'
collect2: error: ld returned 1 exit status