답안 #557197

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
557197 2022-05-04T20:56:51 Z n0sk1ll 쌀 창고 (IOI11_ricehub) C++14
0 / 100
3 ms 408 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; 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

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]
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 232 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 408 KB Output isn't correct
2 Halted 0 ms 0 KB -