Submission #557195

# Submission time Handle Problem Language Result Execution time Memory
557195 2022-05-04T20:55:06 Z n0sk1ll Rice Hub (IOI11_ricehub) C++14
0 / 100
2 ms 340 KB
#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,l=0,r=0; li t=0;
	while (r<n)
    {
        t+=x[r++]-x[(l+r)/2];
        while (t>b) t-=x[(l+r)/2]-x[l++];
		mx=max(mx,r-l);
	}
	return mx;
}

Compilation message

ricehub.cpp: In function 'int besthub(int, int, int*, li)':
ricehub.cpp:12:15: warning: operation on 'r' may be undefined [-Wsequence-point]
   12 |         t+=x[r++]-x[(l+r)/2];
      |              ~^~
ricehub.cpp:12:15: warning: operation on 'r' may be undefined [-Wsequence-point]
ricehub.cpp:13:38: warning: operation on 'l' may be undefined [-Wsequence-point]
   13 |         while (t>b) t-=x[(l+r)/2]-x[l++];
      |                                     ~^~
ricehub.cpp:13:38: warning: operation on 'l' may be undefined [-Wsequence-point]
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -