Блог пользователя adityav664

Автор adityav664, история, 22 месяца назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор adityav664, 2 года назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор adityav664, история, 2 года назад, По-английски

Hey Everyone

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор adityav664, 2 года назад, По-английски

I have issue in question named as C. Rumor -893C, link :- https://mirror.codeforces.com/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://mirror.codeforces.com/contest/893/submission/167180749. thanks in advance.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -2
  • Проголосовать: не нравится