답안 #557195

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
557195 2022-05-04T20:55:06 Z n0sk1ll 쌀 창고 (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]
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -