Submission #582163

# Submission time Handle Problem Language Result Execution time Memory
582163 2022-06-23T13:08:34 Z TimDee Colouring a rectangle (eJOI19_colouring) C++14
Compilation error
0 ms 0 KB
        #include <bits/stdc++.h>
        using namespace std;
		ising ll = long long;
        //#define int long long
        #define forn(i,n) for (int i=0; i<n; ++i)
    	const int linf = LLONG_MAX;
		const int maxn = 2e5+5;
         
        int32_t main() {
          
          int n,m; cin>>n>>m;
          vector<ll> a(maxn), b(maxn);
          forn(i,n+m-1) cin>>a[i];
          forn(i,n+m-1) cin>>b[i];
          ll ans=0;
          forn(i,n+m-1) ans+=min(a[i],b[i]);
          cout<<ans<<'\n';
          
          return 0;
        }

Compilation message

colouring.cpp:3:3: error: 'ising' does not name a type; did you mean 'isinfl'?
    3 |   ising ll = long long;
      |   ^~~~~
      |   isinfl
colouring.cpp:6:23: warning: overflow in conversion from 'long long int' to 'int' changes value from '9223372036854775807' to '-1' [-Woverflow]
    6 |      const int linf = LLONG_MAX;
      |                       ^~~~~~~~~
colouring.cpp: In function 'int32_t main()':
colouring.cpp:12:18: error: 'll' was not declared in this scope
   12 |           vector<ll> a(maxn), b(maxn);
      |                  ^~
colouring.cpp:12:20: error: template argument 1 is invalid
   12 |           vector<ll> a(maxn), b(maxn);
      |                    ^
colouring.cpp:12:20: error: template argument 2 is invalid
colouring.cpp:13:31: error: invalid types 'int[int]' for array subscript
   13 |           forn(i,n+m-1) cin>>a[i];
      |                               ^
colouring.cpp:14:31: error: invalid types 'int[int]' for array subscript
   14 |           forn(i,n+m-1) cin>>b[i];
      |                               ^
colouring.cpp:15:13: error: expected ';' before 'ans'
   15 |           ll ans=0;
      |             ^~~~
      |             ;
colouring.cpp:16:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |           forn(i,n+m-1) ans+=min(a[i],b[i]);
      |                         ^~~
      |                         abs
colouring.cpp:16:35: error: invalid types 'int[int]' for array subscript
   16 |           forn(i,n+m-1) ans+=min(a[i],b[i]);
      |                                   ^
colouring.cpp:16:40: error: invalid types 'int[int]' for array subscript
   16 |           forn(i,n+m-1) ans+=min(a[i],b[i]);
      |                                        ^
colouring.cpp:17:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |           cout<<ans<<'\n';
      |                 ^~~
      |                 abs