Codeforces Round 865 : Problem- C: Ian and Array Sorting || comp exp + code

  Рет қаралды 2,258

Code With Singh

Code With Singh

Күн бұрын

#python #india #coding
#python #india #coding
#python #india #hacking
#python #india #hacking
#python #india #hacking
#python #india #hacking
#python #india #hacking
#python #india
#python #india
#python #india #hacking
#python #coders #hacking
#python #coders #hacking
#python #coders #hacking
#coders #programmingmemes #python
#programming #hacking #programmers
##codeforcesround863
#IanandArraySorting
#IanandArraySorting
#div3codeforces
#CodeforcesRound863
#codeforcesround863
#codeforceslatestsolution
#codeforceslatestsolution
#programmer
#codeforcesdiv2
#programmers
#codeforces #programming #programmer
#programmers #programming #python
#programming #python #coding
#india #programmer
#india
#programming
#codeforcessolutions
#div3
#div2
#latestcontestsolutions
#programming #programmer #programmers #developer #coder #programmingmemes #coders #coding #frontenddeveloper #backenddeveloper #html #softwaredeveloper #hacking #python

Пікірлер: 25
@EngineerPrabhatSingh
@EngineerPrabhatSingh Жыл бұрын
Code of this problem:- pls like and subscribe if like the videos. it will motivate me to make more videos.. #include using namespace std; #define int long long int signed main(){ int t;cin>>t; while ( t--) { int n;cin>>n;vectorv(n+1); for ( int i = 0; i >v[i]; } if(n%2){ cout
@adityatolgekar8357
@adityatolgekar8357 Жыл бұрын
Thanks for the solution
@CristianoRonaldo-ku1uz
@CristianoRonaldo-ku1uz Жыл бұрын
Uff that was great explanation
@mokshmangal9308
@mokshmangal9308 Жыл бұрын
very nice and short code, and also easy to understand.
@EngineerPrabhatSingh
@EngineerPrabhatSingh Жыл бұрын
Thanks brother...
@SreenivasanM-z3l
@SreenivasanM-z3l Жыл бұрын
Sir very well explained but how did you come with different logic for even and odd value of n. How did you arrive at the conclusion that we have to make last value of array a infinite .
@EngineerPrabhatSingh
@EngineerPrabhatSingh Жыл бұрын
Brother If you carefully observe both logic is same just small diff for n odd we observe It's always possible to get ans. I think last value to make infinite because there is no limits on number. And I think to be sorted let's make last one infinite. This way I approach the problem.. Ans is always somewhere in the question just we have to observe and find it.
@pranavshrivastav7233
@pranavshrivastav7233 10 ай бұрын
In even case, how can you be sure ki koi aur method exist nahi karta jis se array sorted ho jaye . I mean esa bhi to ho sakta hai ki aapke logic ke alawa koi aur logic ho jis se array sorted ho jaye .
@vaibhavsingh0404
@vaibhavsingh0404 Жыл бұрын
Very well explained prabhat
@EngineerPrabhatSingh
@EngineerPrabhatSingh Жыл бұрын
Thank you🙏
@astroflexx82
@astroflexx82 Жыл бұрын
Nice Solution!
@EngineerPrabhatSingh
@EngineerPrabhatSingh Жыл бұрын
Thanks brother..
@rishukumarsingh3926
@rishukumarsingh3926 Жыл бұрын
How to develop thought process like this?
@astroflexx82
@astroflexx82 Жыл бұрын
Practice more questions. If you are not able to solve a question, see the editorial and understand their thought process.
@EngineerPrabhatSingh
@EngineerPrabhatSingh Жыл бұрын
Practice smartly. Give time to a question. Try to prove your solution..
@invinishku1542
@invinishku1542 Жыл бұрын
bro odd length array mien agar ye given hai {1,5,2,4,3} to aapke logic ke acc agar infinity banate aaenge back se....then first vaala element to -3 ho jaaega.....and agar even ke logic se chalenge...then last vaala -2 ho jaaega....to odd mien hrr kaise mien kaise possible hai....
@EngineerPrabhatSingh
@EngineerPrabhatSingh Жыл бұрын
-3 hone se kya problem h. Even and odd ka logic alag alag h
@invinishku1542
@invinishku1542 Жыл бұрын
@@EngineerPrabhatSingh i read problem statement again ..i got it...negative values bhi allowed thi...negative infinity to infinity kuch bhi possible tha...we just need to make it sorted
@EngineerPrabhatSingh
@EngineerPrabhatSingh Жыл бұрын
👍
@astroflexx82
@astroflexx82 Жыл бұрын
@@invinishku1542 Yes negative values are allowed
@sadiyairin339
@sadiyairin339 Жыл бұрын
Very impressive! Bro please make a tutorial for codeforces problem 1811B. I am not getting the logic behind that problem.
@mudrad1930
@mudrad1930 Жыл бұрын
"SOMEONE PLEASE HELP ME .. GIVING WRONG ANSWER FOR PRETEST 3" #include using namespace std; typedef long long ll; typedef pair pll; bool isInc(vector &v){ int n = v.size(); for(int i=1 ; in; vector v(n); for(int i=0 ; i>v[i]; if(isInc(v)) return true; if(n==2 && isInc(v)==false) return false; for(int i=n-1 ; i>=2 ; i--){ ll diff = v[i-1]-v[i]; v[i-1]-=diff; v[i-2]-=diff; } if(n%2==1) return true; else if(v[0]>v[1]) return false; else return true; } int main() { ll t; cin >> t; while (t--) { bool ans = solve(); if(ans) cout
@mudrad1930
@mudrad1930 Жыл бұрын
Done it was just due to integer overflow 😞😞
Educational Codeforces Round 151 :Problem C :- Strong Password || Greedy
15:42
Codeforces Round 870 : Problem- C: Dreaming of Freedom || comp exp + code
14:51
World‘s Strongest Man VS Apple
01:00
Browney
Рет қаралды 69 МЛН
Codeforces 865 (Div. 2) | Problem A-C | Discord discussion
19:07
A Code Daily!
Рет қаралды 1,4 М.
3 Types of Algorithms Every Programmer Needs to Know
13:12
ForrestKnight
Рет қаралды 486 М.
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 843 М.
The Third Problem || Codeforces Round 804 Div2 Problem C
26:36
Competitive Coding - Newton School
Рет қаралды 2 М.
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2,2 МЛН
Dear Functional Bros
16:50
CodeAesthetic
Рет қаралды 531 М.
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 129 М.
Codeforces Round 865 (Div. 2) B-E / (Div. 1) A-C (video editorial)
32:57