Doremy's IQ || Codeforces Round 808 Div2 Problem C

  Рет қаралды 3,756

Competitive Coding - Newton School

Competitive Coding - Newton School

Күн бұрын

Пікірлер: 50
@utkarshsharma1185
@utkarshsharma1185 Жыл бұрын
Thanks
@shivam-eh1ew
@shivam-eh1ew 2 жыл бұрын
Your explanation is pretty straightforward and helpful ... Thanks a lot
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Thanks Shivam :)
@mukundshah1314
@mukundshah1314 2 жыл бұрын
Well Explained
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Thanks Mukund
@ssv6055
@ssv6055 2 жыл бұрын
thenks bhaiya!
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
No worries
@cristeinfuze8574
@cristeinfuze8574 2 жыл бұрын
Your editorial helping me alot ..... Thank you !
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Appreciate it Cristein :)
@maheriyajatinbharatbhai3538
@maheriyajatinbharatbhai3538 2 жыл бұрын
best explanation keep it up 😍😇
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Thanks Jatin
@thamidurandilbandara415
@thamidurandilbandara415 2 жыл бұрын
sir, if i can't solve div2 C should i try to solve div2D so that i become good at div2C or keep practicing div2C?
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Keep doing div2c, also this problem was bit harder than a normal div2c so don't worry that much.
@thamidurandilbandara415
@thamidurandilbandara415 2 жыл бұрын
@@competitivecoding-newtonsc9601 thx
@AryanGupta-nt5qi
@AryanGupta-nt5qi 2 жыл бұрын
I have a doubt, that why will long long underflow if the size of bad array is 0. Wouldn't it result in -1 ?
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
bad.size() returns unsigned int, and if you do -1 it will underflow.
@AryanGupta-nt5qi
@AryanGupta-nt5qi 2 жыл бұрын
@@competitivecoding-newtonsc9601 okk thankyou got it
@AryanGupta-nt5qi
@AryanGupta-nt5qi 2 жыл бұрын
@@competitivecoding-newtonsc9601 please share your discord link
@KCOpardeepkumarvishkarma
@KCOpardeepkumarvishkarma 2 жыл бұрын
why should we type cast v.size() I didn't get it how it will underflow In long long
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
What I meant to say was not long long, but return type of .size() is unsigned int so -1 will set it to INT_MAX.
@GAmil890
@GAmil890 2 жыл бұрын
Bro how we know wether we take that bad contest or not i cant understand it
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
You start with IQ q and try to attend all the contest starting from that bad contest. If while attending the contest your IQ drops less than 0, then you were not able to attend all the contests i.e. this bad contest doesn't obey the lemma and isn't part of the optimal solution.
@GAmil890
@GAmil890 2 жыл бұрын
Thx bro I understand it
@shantanukumar4958
@shantanukumar4958 2 жыл бұрын
Can you please make video on problem A of this contest ..i didn't get the concept 🥲
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
You can join the discord to discuss your doubt, will be hard to make a video now. discord.com/invite/aFBTauq
@shreyasjain9382
@shreyasjain9382 2 жыл бұрын
Going through your solutions after a bad contest really helps man :)
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Glad to help
@kumaramit04-q6c
@kumaramit04-q6c 2 жыл бұрын
I thought of backtracking first, where we can try by selecting or non selecting each of the elements to get the maximum. But i knew it'll give TLE😅
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Yeah thats basically bruteforce lol
@boyidapumohit4715
@boyidapumohit4715 2 жыл бұрын
@@competitivecoding-newtonsc9601 But I guess we can optimise that with dp? I tried to solve in dp, but couldnot implement in contest, BUt now got to know abut greedy sol\
@ahmednafis
@ahmednafis 2 жыл бұрын
@@boyidapumohit4715 dp will have O(n ^2) solution which will also give TLE, also u cant store the DP under given constraints too.
@ganeshchowdhary3024
@ganeshchowdhary3024 2 жыл бұрын
@@boyidapumohit4715 I tried DP knowing that it has a complexity of O(n^2). You have to find the total number of ones possible from each dp state and traverse the dp tree to find where we have taken one or zero. If nn then the answer is all ones. So it is O(n*n)
@sidharthdhiman4522
@sidharthdhiman4522 2 жыл бұрын
can you chnge your sublime theme if possible , like monokai if possible , in video sometimes not able to see the code clearly
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
You can see the code from CF profile. I will increase the font going forward.
@ankitghosh9873
@ankitghosh9873 2 жыл бұрын
Understood bt what is lemma!
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Lemma is kind of a argument that proves a theorem.
@amchourasia
@amchourasia 2 жыл бұрын
10:50 got to know something that is really important for me
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Glad it helped
@ganeshchowdhary3024
@ganeshchowdhary3024 2 жыл бұрын
I think it is good to know both binary search and greedy solutions. Because, sometimes i felt that greedy solutions are quite intuitive and easy to get when compared to isPossible/checker function of binary search.
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
In this case, greedy was pretty hard to think about in my opinion. Almost all the top coders used binary search.
@kabboghosh1853
@kabboghosh1853 2 жыл бұрын
it's very hard to get this kind of lemma, i don't know how u find such kind of observations
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
I think what helped is that, if you give a bad contest, it will affect following contests and make some of them bad. So you want to give bad contests as late as possible. And don't be demotivated as this problem was way harder than a standard div2c, many Reds said the same thing so.
@kabboghosh1853
@kabboghosh1853 2 жыл бұрын
@@competitivecoding-newtonsc9601 thanks
@ganeshchowdhary3024
@ganeshchowdhary3024 2 жыл бұрын
@@competitivecoding-newtonsc9601 Maximize - as late as possible, minimize - as early as possible. Makes sense
@realnight_bot2536
@realnight_bot2536 2 жыл бұрын
Wow🆒👍
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
:)
@realnight_bot2536
@realnight_bot2536 2 жыл бұрын
@@competitivecoding-newtonsc9601 could u please take a session on cf profile review, 🙂just for some advice and fun
@yourbestie4138
@yourbestie4138 2 жыл бұрын
niceee
@competitivecoding-newtonsc9601
@competitivecoding-newtonsc9601 2 жыл бұрын
Thanks
@kuldeep-ju7iy
@kuldeep-ju7iy Жыл бұрын
I have used lower bound but it is giving wa on test 3… I can also show my code can you pliss tell me why it is giving wrong ans… //Think twice code once :)) #include using namespace std; typedef long long ll; #define pb push_back typedef long double ld; //typedef __int128 lll; signed main(){ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll tt=1;cin>>tt;string pi = "3.141592653589793238462643383279"; while(tt--){ll n,q;cin>>n>>q;ll arr[n];ll a[n]={0};string s1="";ll b[n]; for(int i=0;i>arr[i];b[i]=arr[i]; }ll p=0; for(int i=0;i=n){u=n-1;} if(n-u>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>............................................ /*ll n,k;cin>>n>>k; if(n%2==0){ if(k%n)cout
Digital Logarithm || Codeforces Educational Round 135 Div2 Problem C
17:29
Competitive Coding - Newton School
Рет қаралды 3,3 М.
Awoo's Favorite Problem || Codeforces Educational Round 130 Div2 Problem C
14:24
Competitive Coding - Newton School
Рет қаралды 7 М.
Это было очень близко...
00:10
Аришнев
Рет қаралды 4,8 МЛН
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 11 МЛН
Всё пошло не по плану 😮
00:36
Miracle
Рет қаралды 2,8 МЛН
Bricks and Bags || Codeforces Round 831 Div1+2 Problem C
16:52
Competitive Coding - Newton School
Рет қаралды 4,4 М.
Meeting on the Line || Codeforces Round 823 Div2 Problem B
15:16
Competitive Coding - Newton School
Рет қаралды 4,2 М.
Educational Round #127 || A,B,C,D || Complete Solutions
34:08
Competitive Coding - Newton School
Рет қаралды 1,6 М.
Binary String || Codeforces Educational Round 128 Div2 Problem C
18:21
Competitive Coding - Newton School
Рет қаралды 6 М.
Problem C Equal Frequencies
19:24
A Code Daily!
Рет қаралды 1,7 М.
Codeforces Round 843 Div 2 | Problem B : Gardener And The Array Solution | Newton School
20:38
Coding Community | Newton School
Рет қаралды 3,1 М.
Color the Picture || Codeforces Round 810 Div2 Problem C
21:15
Competitive Coding - Newton School
Рет қаралды 6 М.
Это было очень близко...
00:10
Аришнев
Рет қаралды 4,8 МЛН