제출 #712707

#제출 시각아이디문제언어결과실행 시간메모리
712707hoainiemGap (APIO16_gap)C++14
0 / 100
41 ms1912 KiB
#include "gap.h"
#include <bits/stdc++.h>
#define nmax 100008
const long long inf = 1e18 + 8;
using namespace std;
long long findGap(int T, int n)
{
    long long ans = -1, a[nmax];
    a[0] = -1;
    a[n + 1] = inf;
    for (int i = 1, j = n; i <= j; i++, j--){
        if (i < j)
            MinMax(a[i - 1] + 1, a[j + 1] - 1, &a[i], &a[j]);
        else
            MinMax(a[i - 1] + 1, a[j + 1] - 1, &a[i], &a[n + 2]);
    }
  
    for (int i = 1; i <= n; i++)
      assert(a[i] != -1);
 
    for (int i = 1; i < n; i++)
        ans = max(ans, a[i + 1] - a[i]);
 
	return ans;
}

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:21:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   21 |     for (int i = 1; i < n; i++)
      |     ^~~
gap.cpp:24:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   24 |  return ans;
      |  ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...