Submission #605426

#TimeUsernameProblemLanguageResultExecution timeMemory
605426Sam_a17Stations (IOI20_stations)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
 
#define sz(x) (int((x).size()))
#define len(x) (int)x.length()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define dbg(x) cout << #x << " " << x << endl;
#define uniq(x) x.resize(unique(all(x)) - x.begin());
 
#define pb push_back
#define ld long double
#define ll long long
 
// #include "mushrooms.h"
int use_machine(vector<int> m);
 
template<typename T>
void pr(vector<T>& a) {
  cerr << "arr" << " ";
  for(auto i: a) {
    cerr << i << " "; 
  } cerr << endl;
}


long long count_tastiness(long long x, std::vector<long long> a) {
  
  for(int i = 0; i < 66; i++) {
    a.push_back(0);
  }

  int k = sz(a);
  map<long long, long long> mp1, mp2;
  
  //
  mp1[0] = 1;
  
  //
  for(int i = 0; i < k; i++) {
    for(auto j: mp1) {
      mp2[(j.first + a[i]) / 2] += j.second;

      if(j.first + a[i] >= x) {
        mp2[(j.first + a[i] - x) / 2] += j.second;
      }
    } 
    
    mp1 = mp2;
    mp2.clear();
  }

  //
  long long answ = 0;
  for(auto i: mp1) {
    answ += i.second;
  }

	return answ;
}
 

Compilation message (stderr)

/usr/bin/ld: /tmp/ccK0X8Al.o: in function `main':
stub.cpp:(.text.startup+0x2b5): undefined reference to `label(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: stub.cpp:(.text.startup+0x4cc): undefined reference to `find_next_station(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status