Submission #588781

# Submission time Handle Problem Language Result Execution time Memory
588781 2022-07-04T04:40:45 Z Tekor Broken Device 2 (JOI22_device2) C++17
Compilation error
0 ms 0 KB
#include "Anna.h"
#include <utility>
#include <vector>

namespace {

int variable_example = 0;

}
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
int Declare() {
  variable_example++;
  return 2000;
}

std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
	vector <int> a,b;
	for(ll i = 1;i <= 2000;i++) {
		if(i * i >= A) {
			ll val = i * i - A;
			for(int j = 1;j <= min(val,i);j++)a.pb(1);
			for(int j = val + 1;j <= i;j++)a.pb(0);
			val = max(0ll,val - i);
			for(int j = 1;j <= min(val,i);j++)b.pb(1);
			for(int j = val + 1;j <= i;j++)b.pb(0);
			break;
		}
	}
	return mp(a,b);
}
#include "Bruno.h"
#include <utility>
#include <vector>

namespace {

int variable_example = 0;

}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
long long Bruno(std::vector<int> u) {
	ll sz = u.size();
	sz /= 2ll;
	ll k = sz * sz;
	ll cnt = 0;
	for(auto to : u) {
		cnt += to;
	}
	return k - cnt;
}

Compilation message

Anna.cpp: In function 'std::pair<std::vector<int>, std::vector<int> > Anna(long long int)':
Anna.cpp:21:6: error: 'll' was not declared in this scope
   21 |  for(ll i = 1;i <= 2000;i++) {
      |      ^~
Anna.cpp:21:15: error: 'i' was not declared in this scope
   21 |  for(ll i = 1;i <= 2000;i++) {
      |               ^
Anna.cpp:23:6: error: expected ';' before 'val'
   23 |    ll val = i * i - A;
      |      ^~~~
      |      ;
Anna.cpp:24:27: error: 'val' was not declared in this scope
   24 |    for(int j = 1;j <= min(val,i);j++)a.pb(1);
      |                           ^~~
Anna.cpp:25:16: error: 'val' was not declared in this scope
   25 |    for(int j = val + 1;j <= i;j++)a.pb(0);
      |                ^~~
Anna.cpp:26:4: error: 'val' was not declared in this scope
   26 |    val = max(0ll,val - i);
      |    ^~~

Bruno.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~