Submission #1004362

#TimeUsernameProblemLanguageResultExecution timeMemory
1004362jamjanekBulldozer (JOI17_bulldozer)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
pair<pair<int,int>,int>tab[2010];
int miejsce[2010];
vector<pair<int,int>>vec;
int main()
{
  int n, i, j;
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d%d%d", &tab[i].first.first, &tab[i].first.second, &tab[i].second);
  }
  sort(tab, tab+n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++)
      if(i!=j){
        vec.push_back({i,j});
      }
  }
  sort(vec.begin(), vec.end());
  for(i=0;i<n;i++){
    ustaw(i, tab[i].second);
    miejsce[i] = i;
  }
    long long res = max(0ll, tree[1].maxi);
  for(i=0;i<(int)vec.size();i++){
    swap(miejsce[vec[i].first], miejsce[vec[i].second]);
    ustaw(miejsce[vec[i].first], tab[vec[i].first].second);
    ustaw(miejsce[vec[i].second], tab[vec[i].second].second);
    if(i!=(int)vec.size()-1 && notparallel(vec[i], vec[i+1]))
      res = max(res, tree[1].maxi);
  }
  printf("%lld\n", res);
}

Compilation message (stderr)

bulldozer.cpp: In function 'int main()':
bulldozer.cpp:22:5: error: 'ustaw' was not declared in this scope
   22 |     ustaw(i, tab[i].second);
      |     ^~~~~
bulldozer.cpp:25:30: error: 'tree' was not declared in this scope; did you mean 'free'?
   25 |     long long res = max(0ll, tree[1].maxi);
      |                              ^~~~
      |                              free
bulldozer.cpp:28:5: error: 'ustaw' was not declared in this scope
   28 |     ustaw(miejsce[vec[i].first], tab[vec[i].first].second);
      |     ^~~~~
bulldozer.cpp:30:32: error: 'notparallel' was not declared in this scope
   30 |     if(i!=(int)vec.size()-1 && notparallel(vec[i], vec[i+1]))
      |                                ^~~~~~~~~~~
bulldozer.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |   scanf("%d", &n);
      |   ~~~~~^~~~~~~~~~
bulldozer.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%d%d%d", &tab[i].first.first, &tab[i].first.second, &tab[i].second);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~