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

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

hi there <3 share your style of training i mean when you go on more virtual contests , solve hard problems , time you give to problem , what you do when you want to break new rate I hope this blog are useful for me and others

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

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

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

hey there ! i don’t know many people in the field of cp. I would like to participate in the IEEE competition this year and am looking for someone from Egypt who is interested in joining me.

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

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

Автор _Halabi, история, 3 месяца назад, По-английски
  • Проголосовать: нравится
  • -11
  • Проголосовать: не нравится

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

i tried to solve this problem but i have WA 19 , many trials without result so i hope some one can help me <3

my solutin idea :

for each u  we preprocess it that we store for it the 1<<k elemnt after  u in valid sequence    dp[u][k]  and sum untill this elemnt   sum[u][k]  >>  so we can ans queryies about u in log time

submission : 268374991

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

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

Автор _Halabi, история, 8 месяцев назад, По-английски
  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

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

i don't know if this work for all contests ! but if u want to see the wrong case in your code in GYM (if the test cases are hidden) clone the contest and u can see the test cases for your submission .

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

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

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

https://codeforces.net/edu/course/2/lesson/5/4/practice/contest/280801/problem/F

this the lst problem at edu >>segment tree >>part2 the submissions are closed so i need hint !

UPD :
finaly I got AC !

i'm not good enough to write educational blogs  but i write this part as i didn't a lot of sources that explain dynamic segtree .


    this problem need a dynamic segtree  . the idea is that when you have large array (1...1e9)

it's difficult to make the normal segment tree because this need large space but in the same time time complexity is ok and the number of nodes that i visit over all queries are q*(log N) so why we need all this space ?

we can just start from the root nd and iterate on we just need and remark nodes by map such that u will give each node u visit unique id (if it doesn't have one ) and by this id u can for this nd all the information you need but this still take a lot of time and space !

so we will do the same but making each nd holds :

1. ( it's information  , lft  child pointer , rght  pointer , lx , rx )  
   2. function extend that create the two child (lft , rght )

so we can start our basic operation from the root ( it's informaion , lft ,rght , 0,sz) and each nd we visit we extend two childs from and update thier information

code : struct node{ // description bool op = 0 ; int oper =0 ; item val ;

//intialize nd
    node (){
            oper = 0;
            val =  {0,0} ;
    }

    node *  lft  =NULL  , *rght=NULL  ;   //create my two childs
    void extend()         
     {

               int md  = (lx+rx)/2;
               if (lft==NULL){
                       lft  =  new node;
                       lft ->lx =lx;
                       lft->rx =md;
               }

               if (rght==NULL){
                    rght = new node;
                    rght->lx= md;
                    rght->rx = rx;

               }
    }

}

my submission for the problem (it needs more optimiztion ) : https://www.ideone.com/mhb2PB

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

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

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

hey there ! /* . if u have a mentor or your rate > 1400 this blog isn't for u <3 . this roadmap is mine and isn't the best but i think it will be useful for u (better than nothing XD) .I'm not english native so my english isn't very good and the sources of topics i'll mention is arabic so i hope people mention english sources for this topics and sheets to practise on it ._anything you don't know search on youtube 'll find alot of videos

*/
in our start at training we need to balance between  : 
 1.solving general problems  (u don't topics needed to solve it 
 2. learning new topic and practise on it untill you be able to solve it's problems
 3. contests (div  4, 3, 2, 1   ...etc) 


so our roadmap : 
1.   C+ basics  ( conditions ,  loops , arrays ,functions )  and practise on it .

2.   from this ladder  enter handle  >> div2 >>A and you will get 100 problem  , solve the first 50 from them 
       link :  /*https://a2oj.netlify.app/ladders*/

3 . learn STLS (  u don't need to learn how they work just learn thier basic functions ).

4. solve from the same ladder >>div2>>a the rest 50 problem  

5.  learn binary search , two pointers , static range queries  

6 . from the same ladder div2>>B solve the first 50

7. now i guess u have the ability to solve A div2 and maybe B so it's time to know that problem on codeforces 
   are divided according to difficulty (800 .. 3500 ) so we will start from 1000 and for each difficulty we will solve 
   untill we able to solve it's problems (no matter time  cause higher problems will make it easy  ) and i think that 30 
   problems of each difficulty is enough  and then from one to higher.
  1. from problemset >> choose difficulty >> solve from 1000 as explained above untill 1200 and then learn recursion

  2. solve untill 1400 and then learn graph (BFS, DFS ,Dijkstra )

10 . solve untill 1600 and then learn DP , then 1700 ,1800

  1. solve 15 problem 1900 and learn DSU

12 .another 15 problem and then learn segment tree from EDU part at codeforces

  1. solve 10 problems from (2000) , learn hashing
  1. if you intend to pariticipate at icpc so every week you enter a contest from GYM that similar to icpc style

15.waiting .....

general notes :
             _never see tags of problem   and you can hide tags from the settings
            _ after step 1 u will always enter contests and some times when you stop entering contests for some time  you 
               maybe need to enter virtual contests
            _always try to up solve after contests 
            _ there's topics like number theory and bitmasking these topics won't take time from you and you will learn it 
              from problem or from searching
            _ read others codes 
            _hv fun XD

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

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

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

link : https://csacademy.com/app/graph_editor/

if u are in a contest and u need to save time you can copy the edges (u , v , w) and this site will draw graph for u

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

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

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

i need fast lCA fuction for a tree ( normal problems constraints) to add it to my library untill i learn topics like (sparse table , ..etc)

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

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

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

if i need to divide the array into two subsets with the minimum diference between the sum of the two sets what i can do i know the dp(idx,sum) solution but i need faster one

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

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

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

in this problem : / *https://codeforces.net/contest/1614/problem/C */

can any body explain why ((in the editorial he multiplied x at 2 to power n-1 to get the sum of (The Xoring of each subsequence). I understand until this part ("Thus, the i -th bit is included in exactly 2|A|⋅2|B|−1=2n−1 subsequences, which was required to be proved.")

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

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

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

nowadays some channels at Youtube solve contest while the contest running the idea that the problems they solve aren't the most difficult problems like A,B Div2 and solving these problem i think will affect a newbie like me who try to be pupil i hope that this problem take some focus from us and codeforces admisions

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

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

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

207259291

/* the idea is to take the k smallest elements in vector and by prefix array check all the choices to find the mi answer */

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

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