Codeforces Round 831 Div1+2|C. Bricks and Bags||code+Explanation

  Рет қаралды 1,144

Code With Singh

Code With Singh

Күн бұрын

Пікірлер: 9
@EngineerPrabhatSingh
@EngineerPrabhatSingh 2 жыл бұрын
solution for this problem.......... #include using namespace std; #define int long long int signed main(){ int t; cin>>t; while ( t--) { int n; cin>>n; vectorv(n); for ( int i = 0; i < n; i++) { cin>>v[i]; } sort(v.begin(),v.end()); int ans=0; for ( int i = 0; i =2; i--) { ans=max(ans,v[i]-v[i-1]+v[i]-v[0]); } cout
@psurya3053
@psurya3053 2 жыл бұрын
thanks paaji , tusi great ho
@EngineerPrabhatSingh
@EngineerPrabhatSingh 2 жыл бұрын
Thanks Bhai. Support the channel.
@xolo2617
@xolo2617 2 жыл бұрын
thanks sir , i was get logic from one side but never thought of to run from opposite side and now my solution(java) got accepted
@EngineerPrabhatSingh
@EngineerPrabhatSingh 2 жыл бұрын
Thanks
@Negijicoder
@Negijicoder 7 ай бұрын
maine bhi same logic lagaya tha jo phle btaya..😂😂😂😂 (kya kru hote hi nahi questions...1400 ke ab tak 60+ kr liye fir bhi atak hi jata hu..)
@ayyappaswamy8220
@ayyappaswamy8220 2 жыл бұрын
In the first example if we pick bricks whose weights are 1 5 2 the answer would be 7 which is greater than 6. Why shouldn't we pick 1 5 2
@unibrow9384
@unibrow9384 2 жыл бұрын
Ur CF handle?
@EngineerPrabhatSingh
@EngineerPrabhatSingh 2 жыл бұрын
prabhatsingh12
Bricks and Bags || Codeforces Round 831 Div1+2 Problem C
16:52
Competitive Coding - Newton School
Рет қаралды 4,5 М.
Codeforces Round 836 Div 2 | Problem C : Almost All Multiples Solution | Newton School
17:56
Coding Community | Newton School
Рет қаралды 2,1 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 136 МЛН
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 63 МЛН
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 36 МЛН
Problem C. Elemental Decompress | Codeforces | round 842 div2
16:18
A Code Daily!
Рет қаралды 1,2 М.
Almost All Multiples || Codeforces Round 836 Div2 Problem C
15:52
Competitive Coding - Newton School
Рет қаралды 1,9 М.
Just enough C to have fun
39:29
Kay Lack
Рет қаралды 69 М.
Learning C# In A Week... Otherwise I Fail University
9:04
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 136 МЛН