Submission #289601

# Submission time Handle Problem Language Result Execution time Memory
289601 2020-09-02T18:53:06 Z Doxeno Rice Hub (IOI11_ricehub) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#pragma GCC optimize ("Ofast")
using namespace std;ì
long long besthub(long long N, long long L, long long risaie[], long long B){
	long long left=0,right=0;
	long long spesa = 0;
	long long m =1;
	while(right<N-1){
		if(spesa>B){
			spesa+=risaie[left]-risaie[(++left+right)/2];
		}else{
			right++;
			spesa+=risaie[right]-risaie[(left+right)/2];
		//	if(spesa<=B)m=max(,max
		}
		if(spesa<=B)m=max(m,right-left+1);
	}
	return m;
}

Compilation message

ricehub.cpp:3:21: error: stray '\303' in program
    3 | using namespace std;ì
      |                     ^
ricehub.cpp:3:22: error: stray '\254' in program
    3 | using namespace std;ì
      |                      ^
ricehub.cpp: In function 'long long int besthub(long long int, long long int, long long int*, long long int)':
ricehub.cpp:10:32: warning: operation on 'left' may be undefined [-Wsequence-point]
   10 |    spesa+=risaie[left]-risaie[(++left+right)/2];
      |                                ^~~~~~
ricehub.cpp:10:32: warning: operation on 'left' may be undefined [-Wsequence-point]