제출 #540519

#제출 시각아이디문제언어결과실행 시간메모리
540519dutinmeowGap (APIO16_gap)C++17
0 / 100
49 ms2324 KiB
#include <bits/stdc++.h> using namespace std; #include "gap.h" const long long MAX_A = 1e18; long long findGap(int T, int N) { if (T == 1) { long long l = 1, r = MAX_A; vector<long long> A; for (int i = 0; i < (N + 1) / 2; i++) { long long nl, nr; MinMax(l, r, &nl, &nr); A.push_back(nl); A.push_back(nr); l = ++nl, r = --nr; } assert(A.size() == N); sort(A.begin(), A.end()); long long ans = 0; for (int i = 1; i < N; i++) ans = max(ans, A[i] - A[i - 1]); return ans; } else { } }

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

In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from gap.cpp:1:
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:19:19: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   19 |   assert(A.size() == N);
      |          ~~~~~~~~~^~~~
gap.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...