Submission #916219

# Submission time Handle Problem Language Result Execution time Memory
916219 2024-01-25T13:43:07 Z kachu Truck Driver (IOI23_deliveries) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include "deliveries.h" 

int a, b, d;

void init(int N, std::vector<int> U, std::vector<int> V, std::vector<int> T, std::vector<int> W) {
	a = W[0];
	b = W[1];
	d = T[0];
}

long long max_time(int S, int X){
	if (S == 0) a = X;
	else b = X;
	
	int ans;
	ans = min(a, b + 1) * d;
	
	return ans;
}

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	return 0;
}

Compilation message

deliveries.cpp: In function 'long long int max_time(int, int)':
deliveries.cpp:19:8: error: 'min' was not declared in this scope; did you mean 'std::min'?
   19 |  ans = min(a, b + 1) * d;
      |        ^~~
      |        std::min
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from deliveries.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
deliveries.cpp: In function 'int32_t main()':
deliveries.cpp:25:2: error: 'ios_base' has not been declared
   25 |  ios_base::sync_with_stdio(false);
      |  ^~~~~~~~
deliveries.cpp:26:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   26 |  cin.tie(NULL);
      |  ^~~
      |  std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from deliveries.cpp:1:
/usr/include/c++/10/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;  /// Linked to standard input
      |                  ^~~
deliveries.cpp:27:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |  cout.tie(NULL);
      |  ^~~~
      |  std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from deliveries.cpp:1:
/usr/include/c++/10/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~