제출 #287706

#제출 시각아이디문제언어결과실행 시간메모리
287706luciocfpopa (BOI18_popa)C++14
0 / 100
21 ms504 KiB
#include <bits/stdc++.h>
#include "popa.h"
 
using namespace std;
 
int solve(int N, int *l, int *r)
{
	memset(l, -1, sizeof l); memset(r, -1, sizeof r);

	int n = N;
 
	stack<int> stk;
 
	for (int i = 0; i < n; i++)
	{
		while (stk.size() && query(stk.top(), i, i, i))
		{
			l[i] = stk.top();
			stk.pop();
		}
 
		if (stk.size()) r[stk.top()] = i;
 
		stk.push(i);
	}
 
 	return stk.top();
}

컴파일 시 표준 에러 (stderr) 메시지

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:8:16: warning: argument to 'sizeof' in 'void* memset(void*, int, size_t)' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
    8 |  memset(l, -1, sizeof l); memset(r, -1, sizeof r);
      |                ^~~~~~~~
popa.cpp:8:41: warning: argument to 'sizeof' in 'void* memset(void*, int, size_t)' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
    8 |  memset(l, -1, sizeof l); memset(r, -1, sizeof r);
      |                                         ^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...