Medeali's blog

By Medeali, history, 2 weeks ago, In English

In today's contest i finally reached pupil after more than 3 months of doing competitive programming,and times when i was so close but then had a bad contest i am still glad i hadn't reached pupil at that time i was not that good anyways and did not deserve it(please upvote).

Full text and comments »

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

By Medeali, history, 2 months ago, In English

I am trying to solve this problem https://lightoj.com/problem/conquering-keokradong i applied binary search and i think my code is fine but i got WA this is my code https://lightoj.com/problem/conquering-keokradong can anyone tell me what is wrong?

Full text and comments »

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

By Medeali, history, 3 months ago, In English

I have started doing cp for 2months now(i registered on codeforces before but i was only discovering at that time) my dream is to make my country IOI team. I can feel the improvememnt a bit(by the way what do you think of my rating graph) however i am always doubting my practice efficiency because i am not using a roadmap or something just random practice and whenever i encounter a new topic on a problem i learn it and pratcie some basic problems to grasp i also tried that ultimate topic list but still everytime i feel there is something wrong and i don't even know dsa or anything so should i learn it first or what however i know that in spite of my lack of experinec i really love cp and OI and am willing to do anything to improve i also tried the USACO guide which i tought would be amazing however the statements were very long and usually they did not require any thinking just heavy implementation in the beginner bronze problems.So i am now asking for help and advice and i hope to get answers unlike other blogs i had posted so please i want help on practice and on my progress whether is it good or not.Thanks again for this wonderful community and this amazing website which is my favourite one for practice.

Full text and comments »

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

By Medeali, history, 3 months ago, In English

I am trying to solve this problem https://www.spoj.com/problems/NDIV/ this is my code https://www.ideone.com/c9uEMT i got SIGKILL but i am confused what is wrong with my code

Full text and comments »

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

By Medeali, history, 4 months ago, In English

i was solving this problem and i got WAbut i am very confused why it said 29th number in testcases https://codeforces.com/contest/1849/problem/B i wrote a program to stop accepting at 29th numbers testcase to spot it but when i tried it had right ouput can you help here's my code https://www.ideone.com/v0tCla i even checked the editorial and i found the same idea as mine but still don't know why WA please help

Full text and comments »

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

By Medeali, history, 4 months ago, In English

hey i was solving this problem https://codeforces.com/contest/754/problem/A and i implemented this code https://www.ideone.com/ but got wrong answer on test 1 however it outputs exactly the same for test 1 as the one in the editorial(i read the editorial but decide to do the implementation on my own) which got accepted i am really confused i checked if i had printed some extra spaces but everything was fine please i need help

Full text and comments »

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

By Medeali, history, 4 months ago, In English

I am high school student interested in Olympiad of Informatics and want to be part of my IOI team . So for my preparation i use codeforces of course but also i try to focus on usaco guide since it has learning ressources sorted with problems like kind of roadmap but i was always wondering is it useful for me although i am not from USA and if yes what other ressources should i include too?? by the way i have been doing cp for 1month you might see me registered 11months ago but my first contest was 1month ago.Anyways i hope you answer my question.

Full text and comments »

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

By Medeali, history, 4 months ago, In English

https://arena.moi/problem/moi21qualnones this is my code #include

include

using namespace std;

int main() { int t; cin>>t; while(t--){ string n; long long a; cin>>n>>a; long long o=0,s=0; for(char i : n){ if(i=='1') s++; if(s==a){ o++; s=0; } } cout<<o<<endl; } return 0; } i am struggling in finding the issue

Full text and comments »

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

By Medeali, history, 4 months ago, In English

I am high school student, I love both maths olympiad and INformatics Olympiad.My dream is to go to both IMO and IOI. I still have 3 years of high school, i know some people who have gone to both of these prestigious competitions but htey have started early preparing at lesat earlier than me(by the way i am already in maths olympiad and still qualifying to rounds so my level is not the worst).I just would love to know if there are some ressources that could help me combine both, I also wanna know whether i should give up on one of them(my goal is only to be in team not gold medal or some high result) or it is still possible for me to make both of them.

Full text and comments »

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

By Medeali, history, 4 months ago, In English

I am gray coder and i just solved a div 1 A problem with 1600 rating.I just started competitive programming amonth now and i solved the problem in about 2 hours.Do you think this is an improvement sign or not here's the problem by the way. https://codeforces.com/contest/559/problem/A if you look at the editorial the solution is trivial but it was hard for me to think about it.

Full text and comments »

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

By Medeali, history, 4 months ago, In English

i was solving this problem "https://codeforces.com/problemset/problem/629/A" but i did not understand the 2nd testcase i think the output should be 8 not 9

Full text and comments »

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

By Medeali, history, 4 months ago, In English

I am high school student from morocco. I am fascinated by algorithms and cp. I have doing cp for a while i know sortings and search. I am really overwhelmed by all the ressources on internet and i would love some help. I am mastering all c++ basics also, I would love some help on ressources or roadmap so i can be prepared for next year's selections in our country.I know it is hard to do it in a year and i will need hardwork and real practice and i am ready to give it everything i just need help onwhat ressources to use or problems to solve because sometimes i keep solvig easy problems like 900 or 1000.I hope to see some answers i really need it this is important for me.

Full text and comments »

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

By Medeali, history, 4 months ago, In English

my code :

include

using namespace std; int subsum(int A[],int n,int index,int sum,int x){ if(sum==x && index!=0) return 1; if(index==n) return 0; return subsum(A,n,index+1,sum+A[index],x)+subsum(A,n,index+1,sum,x);

} int main() { int n,x; cin>>n>>x; int A[n]; for(int i=0;i<n;i++) cin>>A[i]; int b=subsum(A,n,0,0,x); if(x==0) b++; cout<<b; return 0; } Given an array A of N elements and an integer K , we want you to calculate the number of subsets of A whose sum of elements is equal to K .

B is a subset of A if B can be obtained by removing zero or more elements from A .

Full text and comments »

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