Submission #314421

# Submission time Handle Problem Language Result Execution time Memory
314421 2020-10-19T20:24:25 Z urosk Colouring a rectangle (eJOI19_colouring) C++14
0 / 100
336 ms 4876 KB
#include <bits/stdc++.h>
#include <chrono>
#define ll long long
#define ull unsigned long long
#define ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define inf 1e15
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
using namespace std;
using namespace std::chrono;
/*auto start = high_resolution_clock::now();
auto stop = high_resolution_clock::now();
auto duration = duration_cast<microseconds>(stop - start);
cout << "Time taken by function: "
         << duration.count() << " microseconds" << endl;*/
const int maxn = 1e5+1;
int a[2*maxn];
int b[2*maxn];
int main(){
    int n,m;
    cin >> n >> m;
    for(int i = 0;i<n+m-1;i++){
        cin >> a[i];
    }
    for(int i = 0;i<n+m-1;i++){
        cin >> b[i];
    }
    if(n==m){
        ll ans1 = 0;
        ll ans2 = 0;
        for(int i = 0;i<n+m-1;i++){
            ans1+=a[i];
        }
        for(int i = 0;i<n+m-1;i++){
            ans2+=b[i];
        }
        cout<<min(ans1,ans2);
    }else if(n==1){
        ll ans = 0;
        for(int i = 0;i<m+n-1;i++){
            ans+=min(a[i],b[i]);
        }
        cout<<ans;
    }else{
        cout<<0;
    }
}

Compilation message

colouring.cpp:5:9: warning: ISO C++11 requires whitespace after the macro name
    5 | #define ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
      |         ^~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 336 ms 4876 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 189 ms 3320 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -