제출 #549107

#제출 시각아이디문제언어결과실행 시간메모리
549107LucaDantasBroken Device (JOI17_broken_device)C++17
컴파일 에러
0 ms0 KiB
#include "Annalib.h" #include <bits/stdc++.h> void Anna( int N, long long X, int K, int P[] ){ int p[K+1]; for(int i = 0; i < K; i++) p[i] = P[i]; p[K] = N; std::vector<int> valor; while(X) valor.push_back(X % 2), X >>= 1; while(valor.size() % 3) valor.push_back(0); int id = 0, ptr = 0; for(int i = 0; i < N; i++) { if(p[id] < i) ++id; if(p[id] - i >= 4 && valor.size()) { Set(i, 1); for(int j = 1; j < 4; j++) Set(i+j, valor.back()), valor.pop_back(); i += 3; } else Set(i, 0); } }
#include "Annalib.h" #include <bits/stdc++.h> void Anna( int N, long long X, int K, int P[] ){ int p[K+1]; for(int i = 0; i < K; i++) p[i] = P[i]; p[K] = N; std::vector<int> valor; while(X) valor.push_back(X % 2), X >>= 1; while(valor.size() % 2) valor.push_back(0); int id = 0, ptr = 0; for(int i = 0; i < N; i++) { if(p[id] < i) ++id; if(p[id] - i >= 3 && valor.size()) { Set(i, 1); for(int j = 1; j < 3; j++) Set(i+j, valor.back()), valor.pop_back(); i += 2; } else Set(i, 0); } }

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

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:16:14: warning: unused variable 'ptr' [-Wunused-variable]
   16 |  int id = 0, ptr = 0;
      |              ^~~

Bruno.cpp: In function 'void Anna(int, long long int, int, int*)':
Bruno.cpp:16:14: warning: unused variable 'ptr' [-Wunused-variable]
   16 |  int id = 0, ptr = 0;
      |              ^~~
/usr/bin/ld: /tmp/ccbwj4km.o: in function `Anna(int, long long, int, int*)':
Bruno.cpp:(.text+0x195): undefined reference to `Set(int, int)'
/usr/bin/ld: Bruno.cpp:(.text+0x1ce): undefined reference to `Set(int, int)'
/usr/bin/ld: Bruno.cpp:(.text+0x1dd): undefined reference to `Set(int, int)'
/usr/bin/ld: Bruno.cpp:(.text+0x1f6): undefined reference to `Set(int, int)'
/usr/bin/ld: /tmp/ccQTkEwl.o: in function `main':
grader_bruno.cpp:(.text.startup+0x13d): undefined reference to `Bruno(int, int*)'
collect2: error: ld returned 1 exit status