Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
	int x[100],y[100];
	int n;
	cin >> n;
	REP(i,n) cin >> x[i];
	REP(j,n) cin >> y[i];
	long double sum = 0;
	REP(i,n) sum += abs(x[i]-y[i]);
	cout << sum << endl;
	sum = 0;
	REP(i,n) sum += (x[i]-y[i])*(x[i]-y[i]);
	cout << setprecision(20) << fixed << sqrt(sum) << endl;
	sum = 0;
	REP(i,n) sum += abs((x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]));
	cout << cbrt(sum) << endl;
	long double ans4 = -9999;
	REP(i,n) ans4 = max(ans4,abs(x[i]-y[i]));
	cout << ans4 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:27: error: 'i' was not declared in this scope
   31 |         REP(j,n) cin >> y[i];
      |                           ^
a.cc:42:28: error: no matching function for call to 'max(long double&, int)'
   42 |         REP(i,n) ans4 = max(ans4,abs(x[i]-y[i]));
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:42:28: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'int')
   42 |         REP(i,n) ans4 = max(ans4,abs(x[i]-y[i]));
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:42:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   42 |         REP(i,n) ans4 = max(ans4,abs(x[i]-y[i]));
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~