# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
403086 | Pietra | Rice Hub (IOI11_ricehub) | C++14 | 20 ms | 3276 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include <ricehub.h>
#define pii pair<int,int>
#define f first
#define ll long long
#define s second
#define pb push_back
using namespace std ;
const int maxn = 1e5 + 5 ;
ll n, mx, p[maxn], num[maxn], qtd, indbest ;
bool ok(int k){
if(k == 1) return true ;
// cout << "com k = " << k << ":\n" ;
ll c = p[k] - p[1] -((k-1)*num[1]) ;
indbest = 1 ;
for(int i = 2 ; i <= k ; i++){
ll ans = p[k] - p[i] - ((k-i)*num[i]) + ((i - 1)*num[i]) - p[i-1] ;
if(ans <= c) c = ans, indbest = i ;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |