Submission #1207367

#TimeUsernameProblemLanguageResultExecution timeMemory
1207367santialt2Rail (IOI14_rail)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "rail.h" using namespace std; #define ll int #define vl vector<ll> #define vb vector<bool> #define pb push_back #define ff(aa, bb, cc) for(ll aa = bb; aa < cc; aa++) #define pll pair<ll, ll> #define fi first #define se second #define ed "\n" #define all(aaa) aaa.begin(), aaa.end() ll MOD = 1e9+7; void findLocation(ll n, ll first, ll location[], ll stype[]){ stype[0] = 1; location[0] = first; ll minn = INT_MAX; ll pos = 0; ff(i, 1, n){ ll c = getDistance(0, i); if(minn > x){ minn = x; pos = i; } } minn += first; location[pos] = minn; stype[pos] = 2; ll a0 = getDistance(0, a); ll b0 = getDistance(0, b); ff(i, 1, n){ if(i == pos){ continue; } ll a = getDistance(0, i), b = getDistance(pos, i); if(a < b){ location[i] = a+first; stype[i] = 2; } else{ location[i] = minn-b; stype[i] = 1; } } }

Compilation message (stderr)

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:23:27: error: 'x' was not declared in this scope
   23 |                 if(minn > x){
      |                           ^
rail.cpp:31:32: error: 'a' was not declared in this scope; did you mean 'a0'?
   31 |         ll a0 = getDistance(0, a);
      |                                ^
      |                                a0
rail.cpp:32:32: error: 'b' was not declared in this scope; did you mean 'b0'?
   32 |         ll b0 = getDistance(0, b);
      |                                ^
      |                                b0