Submission #567230

# Submission time Handle Problem Language Result Execution time Memory
567230 2022-05-23T09:32:31 Z Abdulmohsen1284 Kitchen (BOI19_kitchen) C++14
0 / 100
1 ms 212 KB
#include"bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class x>
using ordered_set = tree<x, null_type,less<x>, rb_tree_tag,tree_order_statistics_node_update>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

long long a[305],b[305];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    long long n,m,k,sum=0;
    cin>>n>>m>>k;
    bool imp=false;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum-=a[i];
    }
    for(int i=0;i<m;i++)
    {
        cin>>b[i];
        sum+=b[i];
        if(b[i]<k)
            imp=true;
    }
    if(m==2)
    {
        for(int i=0;i<n;i++)
        {
            if(a[i]<2)
                imp=true;
        }
    }
    if(imp||sum<0||k>m)
        cout<<"Impossibe";
    else
        cout<<sum;

}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -