제출 #549104

#제출 시각아이디문제언어결과실행 시간메모리
549104LucaDantasBroken Device (JOI17_broken_device)C++17
0 / 100
1 ms908 KiB
#include "Annalib.h" #include <vector> #include <cstring> #include <algorithm> 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&1), 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) { 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 "Brunolib.h" #include <cstdio> long long Bruno(int N, int A[]) { long long ans = 0; for(int i = 0; i < N; i++) { if(!A[i]) continue; for(int j = 1; j < 4; j++) ans <<= 1, ans |= A[i+j]; i += 3; } return ans; }

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

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:18:14: warning: unused variable 'ptr' [-Wunused-variable]
   18 |  int id = 0, ptr = 0;
      |              ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...