es
Feedback
Codeforces|Leetcode|Codechef free solutions

Codeforces|Leetcode|Codechef free solutions

Ir al canal en Telegram

Free codeforces, Codechef, Leetcode solutions are available 😍😍😍😍😍😍 Helped More than 200+ students to crack coding round in 2022 and helped placed them in Good companies. 🥳🥳🥳🤩🤩🤩 Dm @Cpsoln if you want help in coding round.

Mostrar más
4 317
Suscriptores
Sin datos24 horas
-137 días
-5230 días
Archivo de publicaciones
#include <iostream> #include <vector> #include <algorithm> using namespace std; int minTotalSum(const vector<int>& a, int k) { int n = a.size(); vector<vector<int>> dp(n + 1, vector<int>(k + 1, 1e9)); dp[0][0] = 0; for (int i = 1; i <= n; ++i) { for (int j = 0; j <= k; ++j) { for (int x = max(0, i - 2); x < i; ++x) { dp[i][j] = min(dp[i][j], dp[x][j - (i != n)] + a[x]); } } } int ans = 1e9; for (int j = 0; j <= k; ++j) { ans = min(ans, dp[n][j]); } return ans; } int main() { int t; cin >> t; while (t--) { int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } cout << minTotalSum(a, k) << endl; } return 0; }

After 3850 subscribers I will give B

Codeforces A

#include <bits/stdc++.h> #include <iostream> using namespace std; #define int long long #define endl "\n" #define mod 1000000007 int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t=1; cin >> t; while(t--){ int n; cin >> n; int a[n],f=0; unordered_map<int,int>m; for(int i=0; i<n; i++){ cin >> a[i]; m[a[i]]=i+1; if(m[i+1]==a[i]){ f=1; } } if(f){ cout<<2<<endl; } else{ cout<<3<<endl; } } return 0; }

ZS Campus Beats slots available Dm @Cpsoln

Agoda oa solutions available Dm @Cpsoln

Dm @Cpsoln for coding rounds

Amex all done ✅✅✅

Task 3 done ✅✅✅

Amex Task 2 done ✅✅✅ Task 3 done ✅✅✅

American Express oa slots available Dm @Cpsoln

Oa help available for any companies Dm @Cpsoln before to book the slot.

Jp Morgan slots available Dm @Cpsoln

DE Shaw limited slots available Dm @Cpsoln

Geeks for Geeks Job-a-thon slots available Dm @Cpsoln

Airtel she codes slots available Dm @Cpsoln

American Express slots available Dm @Cpsoln

Accenture slots available Dm @Cpsoln

DE SHAW slots available Done ✅✅✅

Google girls Hackathon all code done ✅✅✅✅ Dm @Cpsoln