제출 #530477

#제출 시각아이디문제언어결과실행 시간메모리
530477byunjaewooBroken Device (JOI17_broken_device)C++17
0 / 100
33 ms2396 KiB
#include "Annalib.h" #include <bits/stdc++.h> using namespace std; bool chk[155]; void Anna( int N, long long X, int K, int P[] ){ for(int i=0; i<K; i++) chk[P[i]]=true; vector<int> V; while(X) { V.push_back(X%2); X/=2; } for(int i=0, p=0; i<150; i+=2) { if(chk[i] || chk[i+1] || p>=V.size()) { Set(i, 0); Set(i+1, 0); continue; } if(V[p]==0) { Set(i, 1); Set(i+1, 1); } else { Set(i, 1); Set(i+1, 0); } } }
#include <bits/stdc++.h> using namespace std; #include "Brunolib.h" long long Bruno( int N, int A[] ){ long long x=0; for(int i=0; i<N; i+=2) { if(!A[i] && !A[i+1]) continue; x*=2; x+=(A[i]^A[i+1]); } return x; }

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

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:15:35: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         if(chk[i] || chk[i+1] || p>=V.size()) {
      |                                  ~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...