제출 #674345

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6743452022-12-23 18:13:02rainboyMinerals (JOI19_minerals)C++17
100 / 100
71 ms8260 KiB
/* https://www.ioi-jp.org/camp/2019/2019-sp-tasks/day4/minerals-review.pdf */
#include "minerals.h"
#include <cstring>
const int N = 43000, L = 19;
int k;
int Query_(int i) {
int k_ = Query(i + 1);
if (k_ == k)
return 0;
k = k_;
return 1;
}
int tt[N * 2], ii[2][N], ii_[1 << L], nn[2], aa[N], bb[N];
int aaa[L * 2 + 2][1 << L], nn_[L * 2 + 2], kk[1 << L];
void Solve(int n) {
for (int i = 0; i < n * 2; i++) {
tt[i] = !Query_(i);
ii[tt[i]][nn[tt[i]]++] = i;
}
for (int a = 0; a < 1 << L; a++) {
int k = 0, l_ = -1;
for (int l = 0; l < L; l++)
if ((a >> l & 1) != (l == 0 ? 0 : (a >> l - 1 & 1)))
k++, l_ = l;
int w = a == 0 ? 0 : k + l_ + 2;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

minerals.cpp: In function 'void Solve(int)':
minerals.cpp:28:46: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
   28 |    if ((a >> l & 1) != (l == 0 ? 0 : (a >> l - 1 & 1)))
      |                                            ~~^~~
minerals.cpp:40:54: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
   40 |    if ((aa[i] >> l & 1) != (l == 0 ? 0 : (aa[i] >> l - 1 & 1)))
      |                                                    ~~^~~
minerals.cpp:44:23: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   44 |    kk[aa[i] & (1 << l + 1) - 1]++;
      |                     ~~^~~
minerals.cpp:44:28: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
   44 |    kk[aa[i] & (1 << l + 1) - 1]++;
      |               ~~~~~~~~~~~~~^~~
minerals.cpp:46:50: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   46 |    if (kk[bb[i]] == 0 || kk[bb[i] | 1 << l] != 0 && Query_(ii[1][i]))
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...