Submission #1349709

#TimeUsernameProblemLanguageResultExecution timeMemory
1349709dashkaShopping (JOI21_shopping)C++20
Compilation error
0 ms0 KiB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;

const int LG = 18;
int n, l, r;

void InitA(int N, int L, int R){
    n = N; l = L; r = R;
    for (int i = 0; i < LG; ++i)
        SendA((L >> i) & 1);
}

int cnt = 0, res = -1;

void ReceiveA(bool x){
    if (x && l + cnt <= r) res = l + cnt;
    ++cnt;
}

int Answer(){
    return res;
}
//Bruno.cpp
#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;

const int LG = 18;

int l = 0, n;
vector <int> p;

void InitB(int N, vector <int> P){
	p = P; n = N;
}a

int cnt = 0;

void ReceiveB(bool y){
	if (y) l |= (1 << cnt);
	cnt ++;

	if (cnt == LG){
		int Min = n + 1;
		for (int i = l; i < n; ++ i){
			if (p[i] < Min) { 
				SendB(1);
				Min = p[i];
			}
			else SendB(0);
		}
	}
}

Compilation message (stderr)

# 2번째 컴파일 단계

Bruno.cpp:14:2: error: 'a' does not name a type
   14 | }a
      |  ^
Bruno.cpp: In function 'void ReceiveB(bool)':
Bruno.cpp:19:27: error: 'cnt' was not declared in this scope; did you mean 'int'?
   19 |         if (y) l |= (1 << cnt);
      |                           ^~~
      |                           int
Bruno.cpp:20:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |         cnt ++;
      |         ^~~
      |         int