제출 #1209410

#제출 시각아이디문제언어결과실행 시간메모리
1209410Theo830Kitchen (BOI19_kitchen)C++20
0 / 100
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e9+7; const ll MOD = 998244353; typedef pair<ll,ll> ii; #define iii pair<ll,ii> #define f(i,a,b) for(ll i = a;i < b;i++) #define pb push_back #define vll vector<ll> #define F first #define S second #define all(x) (x).begin(), (x).end() ///I hope I will get uprating and don't make mistakes ///I will never stop programming ///sqrt(-1) Love C++ ///Please don't hack me ///@TheofanisOrfanou Theo830 ///Think different approaches (bs,dp,greedy,graphs,shortest paths,mst) ///Stay Calm ///Look for special cases ///Beware of overflow and array bounds ///Think the problem backwards ///Training int main(void){ ll n,m,k; cin>>n>>m>>k; ll a[n]; ll ans = 0; f(i,0,n){ cin>>a[i]; ans -= a[i]; } ll b[m]; ll posa = 0; f(i,0,m){ cin>>b[i]; ans += b[i]; posa += min(n,b[i]); } f(i,0,n){ if(a[i] < k){ posa = 0; } } if(posa >= k * n){ cout<<ans<<"\n"; } else{ cout<<"Impossible\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...