제출 #1169681

#제출 시각아이디문제언어결과실행 시간메모리
1169681AgageldiGap (APIO16_gap)C++20
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" #include "gap.h" #include "grader.cpp" using namespace std; #define ll long long #define pb push_back ll n, s, answer, mn, mx, ans, l, r; set <ll> v; ll findGap(int T,int N) { MinMax(0, LLONG_MAX, &l, &r); v.insert(l); v.insert(r); while((int)v.size() < N) { MinMax(l + 1, l + 2, &mn, &mx); if(~mn) v.insert(mn); l += 2; } ans = *v.begin(); for(auto i : v) { answer = max(answer, i - ans); ans = i; } return answer; }#include "bits/stdc++.h" #include "gap.h" #include "grader.cpp" using namespace std; #define ll long long #define pb push_back ll n, s, answer, mn, mx, ans, l, r; set <ll> v; ll findGap(int T,int N) { MinMax(0, LLONG_MAX, &l, &r); v.insert(l); v.insert(r); while((int)v.size() < N) { MinMax(l + 1, l + 2, &mn, &mx); if(~mn) v.insert(mn); l += 3; } ans = *v.begin(); for(auto i : v) { answer = max(answer, i - ans); ans = i; } return answer; }

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

gap.cpp:27:2: error: stray '#' in program
   27 | }#include "bits/stdc++.h"
      |  ^
gap.cpp:27:3: error: 'include' does not name a type
   27 | }#include "bits/stdc++.h"
      |   ^~~~~~~
In file included from gap.cpp:29:
grader.cpp:6:13: error: redefinition of 'void my_assert(int)'
    6 | static void my_assert(int k){ if (!k) exit(1); }
      |             ^~~~~~~~~
In file included from gap.cpp:3:
grader.cpp:6:13: note: 'void my_assert(int)' previously defined here
    6 | static void my_assert(int k){ if (!k) exit(1); }
      |             ^~~~~~~~~
In file included from gap.cpp:29:
grader.cpp:8:18: error: redefinition of 'const int grp_cnt'
    8 | static const int grp_cnt = 4;
      |                  ^~~~~~~
In file included from gap.cpp:3:
grader.cpp:8:18: note: 'const int grp_cnt' previously defined here
    8 | static const int grp_cnt = 4;
      |                  ^~~~~~~
In file included from gap.cpp:29:
grader.cpp:9:12: error: redefinition of 'int subtask_num'
    9 | static int subtask_num, N;
      |            ^~~~~~~~~~~
In file included from gap.cpp:3:
grader.cpp:9:12: note: 'int subtask_num' previously declared here
    9 | static int subtask_num, N;
      |            ^~~~~~~~~~~
In file included from gap.cpp:29:
grader.cpp:9:25: error: redefinition of 'int N'
    9 | static int subtask_num, N;
      |                         ^
In file included from gap.cpp:3:
grader.cpp:9:25: note: 'int N' previously declared here
    9 | static int subtask_num, N;
      |                         ^
In file included from gap.cpp:29:
grader.cpp:10:18: error: redefinition of 'long long int A [4][100001]'
   10 | static long long A[grp_cnt][100001];
      |                  ^
In file included from gap.cpp:3:
grader.cpp:10:18: note: 'long long int A [4][100001]' previously declared here
   10 | static long long A[grp_cnt][100001];
      |                  ^
In file included from gap.cpp:29:
grader.cpp:11:12: error: redefinition of 'int sz [4]'
   11 | static int sz[grp_cnt];
      |            ^~
In file included from gap.cpp:3:
grader.cpp:11:12: note: 'int sz [4]' previously declared here
   11 | static int sz[grp_cnt];
      |            ^~
In file included from gap.cpp:29:
grader.cpp:12:18: error: redefinition of 'long long int call_count'
   12 | static long long call_count;
      |                  ^~~~~~~~~~
In file included from gap.cpp:3:
grader.cpp:12:18: note: 'long long int call_count' previously declared here
   12 | static long long call_count;
      |                  ^~~~~~~~~~
In file included from gap.cpp:29:
grader.cpp:16:6: error: redefinition of 'void MinMax(long long int, long long int, long long int*, long long int*)'
   16 | void MinMax(long long s, long long t, long long *mn, long long *mx)
      |      ^~~~~~
In file included from gap.cpp:3:
grader.cpp:16:6: note: 'void MinMax(long long int, long long int, long long int*, long long int*)' previously defined here
   16 | void MinMax(long long s, long long t, long long *mn, long long *mx)
      |      ^~~~~~
In file included from gap.cpp:29:
grader.cpp:50:5: error: redefinition of 'int main()'
   50 | int main()
      |     ^~~~
In file included from gap.cpp:3:
grader.cpp:50:5: note: 'int main()' previously defined here
   50 | int main()
      |     ^~~~
gap.cpp:35:4: error: redefinition of 'long long int n'
   35 | ll n, s, answer, mn, mx, ans, l, r;
      |    ^
gap.cpp:9:4: note: 'long long int n' previously declared here
    9 | ll n, s, answer, mn, mx, ans, l, r;
      |    ^
gap.cpp:35:7: error: redefinition of 'long long int s'
   35 | ll n, s, answer, mn, mx, ans, l, r;
      |       ^
gap.cpp:9:7: note: 'long long int s' previously declared here
    9 | ll n, s, answer, mn, mx, ans, l, r;
      |       ^
gap.cpp:35:10: error: redefinition of 'long long int answer'
   35 | ll n, s, answer, mn, mx, ans, l, r;
      |          ^~~~~~
gap.cpp:9:10: note: 'long long int answer' previously declared here
    9 | ll n, s, answer, mn, mx, ans, l, r;
      |          ^~~~~~
gap.cpp:35:18: error: redefinition of 'long long int mn'
   35 | ll n, s, answer, mn, mx, ans, l, r;
      |                  ^~
gap.cpp:9:18: note: 'long long int mn' previously declared here
    9 | ll n, s, answer, mn, mx, ans, l, r;
      |                  ^~
gap.cpp:35:22: error: redefinition of 'long long int mx'
   35 | ll n, s, answer, mn, mx, ans, l, r;
      |                      ^~
gap.cpp:9:22: note: 'long long int mx' previously declared here
    9 | ll n, s, answer, mn, mx, ans, l, r;
      |                      ^~
gap.cpp:35:26: error: redefinition of 'long long int ans'
   35 | ll n, s, answer, mn, mx, ans, l, r;
      |                          ^~~
gap.cpp:9:26: note: 'long long int ans' previously declared here
    9 | ll n, s, answer, mn, mx, ans, l, r;
      |                          ^~~
gap.cpp:35:31: error: redefinition of 'long long int l'
   35 | ll n, s, answer, mn, mx, ans, l, r;
      |                               ^
gap.cpp:9:31: note: 'long long int l' previously declared here
    9 | ll n, s, answer, mn, mx, ans, l, r;
      |                               ^
gap.cpp:35:34: error: redefinition of 'long long int r'
   35 | ll n, s, answer, mn, mx, ans, l, r;
      |                                  ^
gap.cpp:9:34: note: 'long long int r' previously declared here
    9 | ll n, s, answer, mn, mx, ans, l, r;
      |                                  ^
gap.cpp:36:10: error: redefinition of 'std::set<long long int> v'
   36 | set <ll> v;
      |          ^
gap.cpp:10:10: note: 'std::set<long long int> v' previously declared here
   10 | set <ll> v;
      |          ^
gap.cpp:38:4: error: redefinition of 'long long int findGap(int, int)'
   38 | ll findGap(int T,int N) {
      |    ^~~~~~~
gap.cpp:12:4: note: 'long long int findGap(int, int)' previously defined here
   12 | ll findGap(int T,int N) {
      |    ^~~~~~~