Submission #1004117

#TimeUsernameProblemLanguageResultExecution timeMemory
1004117vjudge1Kitchen (BOI19_kitchen)C++17
0 / 100
1 ms348 KiB
/* subtask : 3 */ #pragma GCC optimize("O3", "inline") #include <bits/stdc++.h> using namespace std; #define ins insert #define pb push_back #define int long long int #define pii pair<int, int> #define endl '\n' #define drop(x) cout<<(x)<<endl; return; #define all(x) x.begin(),x.end() const int mod = 1e9 +7, sze = 1e5, inf = 2e18, prime = 23; void mal(){ int n,m,k; cin>>n>>m>>k; vector<int> arr(n); for(int i=0;i<n;i++){ cin>>arr[i]; } vector<int> chefs(m); for(int i=0;i<m;i++){ cin>>chefs[i]; } if(m<=2){ multiset<int> lst; int sum=0; int sumb =0; for(auto v:arr){ sum+=v; } for(auto v:chefs){ sumb+=v; } if(sumb<sum || k<m){ drop("Impossible"); } int ans = sumb - sum; drop(ans); return; } } signed main() { cin.tie(0)->sync_with_stdio(0); int tt = 1; // cin>>tt; while(tt--){ mal(); } }
#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...