Codechef Starters 132 | Contest Screencast | Armaan Dutt
HTML-код
- Опубликовано: 17 май 2024
- contest link - www.codechef.com/START132B/
Social media & coding profiles -
- Linkedin - / armaan48
- codeforces - codeforces.com/profile/Armaan48
- codechef - www.codechef.com/users/armaan48
- leetcode - leetcode.com/Armaan48/
chapters
00:00 - GAME_XI ( thinking and coding )
4:40 - ALIENOR ( thinking and coding )
10:19 - OPTMFLP18 ( thinking and coding )
21:35- PRIMEQUERY ( thinking and coding )
42:40 - MEXQUER ( thinking and coding )
55:47 - GOOD_NESS ( thinking )
1:24:27 - RANDOM_ARRAY ( thinking )
algorithms
coding
programming
competitive programming
dsa
Codechef screencast
Codechef
Starters 132 screencast
Starters 132
Codechef Starters 132 screencast
Codechef Starters 132
A. GAME 11
A. GAME 11 Codechef
GAME 11
GAME 11 Codechef
B. ALIEN-OR
B. ALIEN-OR Codechef
ALIEN-OR
ALIEN-OR Codechef
C. Optimal Flip
C. Optimal Flip Codechef
Optimal Flip
Optimal Flip Codechef
D. Prime Query
D. Prime Query Codechef
Prime Query
Prime Query Codechef
E. MEX QUERIES
E. MEX QUERIES Codechef
MEX QUERIES
MEX QUERIES Codechef
F. GAME_XI
F. GAME_XI Codechef
GAME_XI
GAME_XI Codechef
G. ALIENOR
G. ALIENOR Codechef
ALIENOR
ALIENOR Codechef
H. OPTMFLP18
H. OPTMFLP18 Codechef
OPTMFLP18
OPTMFLP18 Codechef
I. PRIMEQUERY
I. PRIMEQUERY Codechef
PRIMEQUERY
PRIMEQUERY Codechef
J. MEXQUER
J. MEXQUER Codechef
MEXQUER
MEXQUER Codechef
#codeforces #screencast #competitiveprogramming #dsa #datastructures #algorithm #problemsolving #contest #editorial #greedy #dynamicprogramming #dp #solutions #computerscience #coding
Nice 👍
Really helpful video broo
Glad it helped
many a times I am able to make a correct logic for the questions but fail in implementation , either it take a lot time to implement the logic or sometimes I can't implement it, Please suggest something to overcome, I will definitely work on that.
Do leetcode easy, medium for which you can make logic easily.. Then try to implement ki yourself.. If you can't or get stuck start reading editorial but in any case don't copy paste code... Understand and Implement ki yourself
brother since how long you're coding and giving contests?
How to improve logic building mere bhai?
Pls tips dedo
I have been giving contests from last 3 years ig.
about improving logic i think practicing harder problems than your comfortable rating range, makes you kill lower rating problem easily and fastly.
so, just do problems
1. which are not unsolvable by you currently
2. and also not which you already can solve easily.
User
#include
using namespace std;
void sol()
{
int n1,n2;
cin>>n1>>n2;
vectorv1(n1,0),v2(n2,0);
int ans = 0;
for(int i = 0; i < n1; i++)
{
int x;
cin>>x;
v1[i] = x;
}
for(int i = 0; i < n2; i++)
{
int x;
cin>>x;
v2[i] = x;
}
sort(v1.begin(),v1.end());
sort(v2.begin(),v2.end());
reverse(v1.begin(),v1.end());
reverse(v2.begin(),v2.end());
ans+=v1[0]+v1[1]+v1[2]+v1[3]+
v2[0]+v2[1]+v2[2]+v2[3];
if(n1 < 4 || n2 < 4 || n1+n2 < 11)
{
cout
if no diff then why it is not accepted
@@gauravpunia4527 your code is absolutely correct. but the thing is 'ans' variable is overflowing . make it long long . then it will 'accepted'
@@gauravpunia4527 code link: codeshare.io/XLK4Vn
what is the problem in my code?????? ignore the commented part
import java.util.*;
class Codechef {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int i = 0; i < t; i++) {
int n = sc.nextInt(); // Number of batsmen
int m = sc.nextInt(); // Number of bowlers
if(n>=4 && m>=4 && (n+m)>=11)
{
//permit to select the team members
int batsman[]=new int[n];
for(int j=0;jbowlers
//3---->batsman
//3 bowlers or batsman
for(int pn=0;pn=0 && bow>=0)
{
if(batsman[bat]>=bowler[bow])
{
sum+=batsman[bat];
bat--;
}else{
sum+=bowler[bow];
bow--;
}
}else if(bat>=0)
{
sum+=batsman[bat];
bat--;
}else{
sum+=bowler[bow];
bow--;
}
}
System.out.println(sum);
}
else{
System.out.println("-1");
}
}
}
}
bro i tried. and modified the code a bit. now it gives AC for first two and then runtime code ( I really don't know why ) - codeshare.io/nAPYjE