Submission #557197

#TimeUsernameProblemLanguageResultExecution timeMemory
557197n0sk1llRice Hub (IOI11_ricehub)C++14
0 / 100
3 ms408 KiB
#include "ricehub.h"
#include<bits/stdc++.h>

using namespace std;
long long int typedef li;

int besthub(int n, int m, int x[], li b)
{
    int mx=0; li t=0;
	for (int l=0,r=0;r<n;){
		for (t+=x[r++]-x[(l+r)/2];t>b;t-=x[(l+r)/2]-x[l++]);
		mx=max(mx,r-l);
	}
	return mx;
}

Compilation message (stderr)

ricehub.cpp: In function 'int besthub(int, int, int*, li)':
ricehub.cpp:11:14: warning: operation on 'r' may be undefined [-Wsequence-point]
   11 |   for (t+=x[r++]-x[(l+r)/2];t>b;t-=x[(l+r)/2]-x[l++]);
      |             ~^~
ricehub.cpp:11:14: warning: operation on 'r' may be undefined [-Wsequence-point]
ricehub.cpp:11:50: warning: operation on 'l' may be undefined [-Wsequence-point]
   11 |   for (t+=x[r++]-x[(l+r)/2];t>b;t-=x[(l+r)/2]-x[l++]);
      |                                                 ~^~
ricehub.cpp:11:50: warning: operation on 'l' may be undefined [-Wsequence-point]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...