Count K-Subsequences of a String with Maximum Beauty Solution || Leetcode Bi-Weekly 112 Get link Facebook X Pinterest Email Other Apps - September 04, 2023 Count K-Subsequences of a String with Maximum Beauty Get link Facebook X Pinterest Email Other Apps
Decomposition Reaction Solution || Codechef Starters - 29 Get link Facebook X Pinterest Email Other Apps - March 09, 2022 Decomposition Reaction Solution Codechef Starters - 29Problem Code : DCPProblem Link : https://www.codechef.com/START29C/problems/DCPSolution :#include <bits/stdc++.h>#define ll long long int#define ull unsigned long long intusing namespace std;void solve(){ ll M = 1000000007; ll n, m; cin >> n >> m; ll a[n]; for (ll i = 0; i < n; i++) { cin >> a[i]; } while (m--) { ll f, ite; cin >> f >> ite; for (ll i = 0; i < ite; i++) { ll t1, t2; cin >> t1 >> t2; a[t2 - 1] += a[f - 1] * t1; a[t2 - 1] = a[t2 - 1] % M; } a[f - 1] = 0; } for (ll i = 0; i < n; i++) { cout << a[i] % M << "\n"; }}int main(){ solve();} Get link Facebook X Pinterest Email Other Apps Comments
Exact Marks Solution || Codechef March Long Challenge 2022 - I - March 11, 2022 Exact Marks Solution Read more
Substring of a Substring Solution || Codechef March Long Challenge 2022 - I - March 11, 2022 Substring of a Substring Solution Read more
Binary Base Basics Solution || Codechef February Long Challenge 2022 - I - February 04, 2022 Binary Base Basics Solution Read more
Comments
Post a Comment