adityav664's blog

By adityav664, history, 21 month(s) ago, In English

I have solved good amount of easy level questions and i have good knowledge of dsa as i have done leetcode and gfg 500+ questions combined but i still can't solve questions, i think i lack in my problem solving skills, so i need help is where i can improve myself and how i can increase my problem solving skills?? Help

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By adityav664, 2 years ago, In English

I'm getting runtime error again and again and i can't seem to find any issue with my code as codeforces custom test compiler is also printing output just fine but when i submit code i get runtime error plz help, these 1 are questions that i'm getting issue with. 1. 120B - Quiz League 178911312

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By adityav664, history, 2 years ago, In English

Hey Everyone

I want to ask that what is the best way to do codeforces, rather then blindly solving random questions?

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By adityav664, 2 years ago, In English

I have issue in question named as C. Rumor -893C, link :- https://codeforces.net/problemset/problem/893/C. I think that i have understand the questions basic as we have to find number of component in graph with minimum price of component and simply we have to do addition i on them. I have come up with pretty good solution but test case 8 getting fail. can you help me where is the problem lies in my code.

include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int solve(){ ll n,m; cin>>n>>m; ll a[n]; for(ll i=0;i<n;i++) cin>>a[i]; for(ll i=0;i<m;i++){ ll x,y; cin>>x>>y; x--;y--; ll t=min(a[x],a[y]); a[x]=t; a[y]=0; } ll res=0; for(ll i=0;i<n;i++) res+=a[i]; cout<<res<<endl; return 0; }

int main(){ ll t=1; //cin>>t; while(t--) solve(); return 0; }

submission link:- https://codeforces.net/contest/893/submission/167180749. thanks in advance.

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it