제출 #403029

#제출 시각아이디문제언어결과실행 시간메모리
403029CursedCodeGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> #define pb push_back using namespace std; long long findGap(int T, long long N){ long long p = 0, q = (lld)1e18 + 1; vector <long long> a; while(true){ long long m1, m2; MinMax(p + 1, q - 1, &m1, &m2); a.pb(m1); a.pb(m2); if (m1 == m2 || a.size() == N) break; p = m1, q = m2; } sort(a.begin(),a.end()); long long ans = 0; for (int i = 1;i < sz(a);i++) ans = max(ans, a[i] - a[i - 1]); return ans; }

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

gap.cpp: In function 'long long int findGap(int, long long int)':
gap.cpp:7:24: error: 'lld' was not declared in this scope; did you mean 'lldiv'?
    7 |  long long p = 0, q = (lld)1e18 + 1;
      |                        ^~~
      |                        lldiv
gap.cpp:13:28: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   13 |   if (m1 == m2 || a.size() == N) break;
      |                   ~~~~~~~~~^~~~
gap.cpp:18:21: error: 'sz' was not declared in this scope
   18 |  for (int i = 1;i < sz(a);i++)
      |                     ^~