Submission #1123887

#TimeUsernameProblemLanguageResultExecution timeMemory
1123887AvianshFruits (NOI22_fruits)C++17
5 / 100
87 ms9284 KiB
#include <bits/stdc++.h> using namespace std; signed main(){ ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; int a[n],c[n]; bool fix[n]; fill(fix,fix+n,0); for(int &i : a){ cin >> i; if(i!=-1) i--; fix[i]=1; } for(int &i : c){ cin >> i; } long long sum = 0; for(int i = n-1;i>=0;i--){ sum+=c[i]; cout << sum << " "; } return 0; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...