Dima
But good years
Anonymous
Lightly in my college
Anonymous
Can u help me
Anonymous
Sen any pdf
Anonymous
Tutorials
Hadaward 'Solly'
/get cbook
Anonymous
/get
Anonymous
/getcbook
Anonymous
/getcbook
Георгий
/getcbook
Anonymous
/get cbook
Anonymous
Thanku
Георгий
Anonymous
Y bro
Anonymous
Y bro
Yo stop spamming
Anonymous
#ot
Anonymous
#bot
Anonymous
/bot
Anonymous
/rose
Георгий
Thx
Anonymous
/rose
Bruh what r u doing?!
Hadaward 'Solly'
buddy, if you really need assistance that badly, ask a concise question. If this behavior continues your access will be terminated
Anonymous
I've got a question
Anonymous
I've got an exam tomorrow but I am really desperate and would pay someone to help me is that okay or it goes against this group's roules?
Anonymous
Bruh what r u doing?!
Ntg I don't know
Anonymous
Just asking sorry for bothering
Anonymous
Ig?
Hadaward 'Solly'
Ig?
"i guess"
Anonymous
Thks
Hadaward 'Solly'
#ot
Hadaward 'Solly'
let's talk about that in off-topic
Anonymous
Hey
Anonymous
I want a little bit help
Anonymous
// C++ Program to Insert an element // at a specific position in an Array #include <iostream> using namespace std; // Function to insert x in arr at position pos int* insertX(int n, int arr[], int x, int pos) { int i; // increase the size by 1 n++; // shift elements forward for (i = n; i >= pos; i--) arr[i] = arr[i - 1]; // insert x at pos arr[pos - 1] = x; return arr; } // Driver Code int main() { int arr[100] = { 0 }; int i, x, pos, n = 10; // initial array of size 10 for (i = 0; i < 10; i++) arr[i] = i + 1; // print the original array for (i = 0; i < n; i++) cout << arr[i] << " "; cout << endl; // element to be inserted x = 50; // position at which element is to be inserted pos = 5; // Insert x at pos insertX(n, arr, x, pos); // print the updated array for (i = 0; i < n + 1; i++) cout << arr[i] << " "; cout << endl; return 0; }
Anonymous
this is thw woking code ...
Anonymous
//writing the program to insert the element in the array . #include<iostream> using namespace std ; int* insert(int a[] , int size , int pos , int val){ size++ ; for (int i = size ; i >= pos ; i--) { a[i] = a[i-1]; } a[pos-1] = val ; return a ; } void print(int a[] , int size){ for (int i = 0; i < size; i++) { cout << a[i] << " " ; } } int main(){ int a[] = {2,7,4,1,5,3} ; int size = sizeof(a)/sizeof(a[0]); cout << "The array before insertion ." << endl ; print(a,size); int pos ; cout << "Enter the position you want to insert the value : " << endl; cin >> pos ; int val ; cout << "Enter what value you want to insert " << endl; cin >> val ; cout << "The array after insertion ." << endl ; insert(a , size , pos ,val); print(a,size); return 0 ; }
Anonymous
why the second code isnt working i want the little help
Anonymous
?
Anonymous
How to do that
Ever heard of pastebin?
Anonymous
Nope
Anonymous
Just heard now from you .
Anonymous
Nope
Nevermind. , Which is your code? Out of those two?
Anonymous
Lower once sir .
Anonymous
Lower once sir .
What is the logic u r implementing for your array insertion?
Anonymous
Inserting array at the position by shifting the value to right .
Anonymous
Actually sir i m 8 grade student so don't know about the logic .
Hadaward 'Solly'
now that's a reference i like
Anonymous
Inserting array at the position by shifting the value to right .
Then u should increase the arry size by 1 i.e a[size+1] and then using the pos that you got push the elements in the the right side of your pos by using a loop to push them from a[i] = a[i+1] and then finally insert your element at the pos that's it...
Anonymous
Thank u
Anonymous
Sir .
Anonymous
Thank u
Did u understand??? In your code u didn't change the array size , and also u did a a[i] = a[i-1]; instead of i+1
Anonymous
ok sir
Anonymous
I understand and i ll try it now
Anonymous
I understand and i ll try it now
It's actaully easy to understand, it might take some time ,when u don't understand what's going on inside the code I suggest you to use print statements between your codes to see what's going on..it actually helped me...
Anonymous
Ok sir thanks for tip . 😊
King Phyte 🐍
dj
is there anything like @lru_cache on python in C++ libraries? so I can implement memoization easily
Mдtt
https://github.com/Gasu16/Race-Conditions
Anonymous
https://github.com/Gasu16/Race-Conditions
This is why I don't do shit on Linux
Anonymous
Insecure trash
Anonymous
food fest is organised at the JLN stadium. The stalls from different states and cities have been set up. To make the fest more interesting, multiple games have been arranged which can be played by the people to win the food vouchers. One such game to win the food vouchers is described below: There are N number of boxes arranged in a single queue. Each box has an integer I written on it. From the given queue, the participant has to select two contiguous subsequences A and B of the same size. The selected subsequences should be such that the summation of the product of the boxes should be maximum. The product is not calculated normally though. To make the game interesting, the first box of subsequence A is to be multiplied by the last box of subsequence B. The second box of subsequence A is to be multiplied by the second last box of subsequence B and so on. All the products thus obtained are then added together. If the participant is able to find the correct such maximum summation, he/she will win the game and will be awarded the food voucher of the same value. Note: The subsequences A and B should be disjoint. Input Format The first line of input consists of the number of boxes, N. The second line of input consists of N space-separated integers. Constraints 1< N <=3000 -106 <= I <=106 Output Format Print the maximum summation of the product of the boxes in a separate line. Sample TestCase 1 Input 8 1 9 2 3 0 6 7 8 Output 104
Anonymous
food fest is organised at the JLN stadium. The stalls from different states and cities have been set up. To make the fest more interesting, multiple games have been arranged which can be played by the people to win the food vouchers. One such game to win the food vouchers is described below: There are N number of boxes arranged in a single queue. Each box has an integer I written on it. From the given queue, the participant has to select two contiguous subsequences A and B of the same size. The selected subsequences should be such that the summation of the product of the boxes should be maximum. The product is not calculated normally though. To make the game interesting, the first box of subsequence A is to be multiplied by the last box of subsequence B. The second box of subsequence A is to be multiplied by the second last box of subsequence B and so on. All the products thus obtained are then added together. If the participant is able to find the correct such maximum summation, he/she will win the game and will be awarded the food voucher of the same value. Note: The subsequences A and B should be disjoint. Input Format The first line of input consists of the number of boxes, N. The second line of input consists of N space-separated integers. Constraints 1< N <=3000 -106 <= I <=106 Output Format Print the maximum summation of the product of the boxes in a separate line. Sample TestCase 1 Input 8 1 9 2 3 0 6 7 8 Output 104
Can anyone help me with a better logic than a 4 nested loop!?🙏
Anonymous
This is C++, mate.. There's no print statement You mean std::cout
ohhh , i never knew C++ syntaxes anyway, i was just assuming there would be print statement of some kind 😅
Anonymous
food fest is organised at the JLN stadium. The stalls from different states and cities have been set up. To make the fest more interesting, multiple games have been arranged which can be played by the people to win the food vouchers. One such game to win the food vouchers is described below: There are N number of boxes arranged in a single queue. Each box has an integer I written on it. From the given queue, the participant has to select two contiguous subsequences A and B of the same size. The selected subsequences should be such that the summation of the product of the boxes should be maximum. The product is not calculated normally though. To make the game interesting, the first box of subsequence A is to be multiplied by the last box of subsequence B. The second box of subsequence A is to be multiplied by the second last box of subsequence B and so on. All the products thus obtained are then added together. If the participant is able to find the correct such maximum summation, he/she will win the game and will be awarded the food voucher of the same value. Note: The subsequences A and B should be disjoint. Input Format The first line of input consists of the number of boxes, N. The second line of input consists of N space-separated integers. Constraints 1< N <=3000 -106 <= I <=106 Output Format Print the maximum summation of the product of the boxes in a separate line. Sample TestCase 1 Input 8 1 9 2 3 0 6 7 8 Output 104
this must be hw or leetcode,hackerrank,etc... u should atleast try out something first...
Anonymous
this must be hw or leetcode,hackerrank,etc... u should atleast try out something first...
All I was able to do it using 4nested loops...but on some online ide's it takes a little longer time than expected...that's why I need help from you guys for a better logic than 4 nested loops
Anonymous
What you mean?
Btw there are mitigations for this
Ибраги́м
https://github.com/typesense/typesense
Mдtt
Btw there are mitigations for this
Ah yes this one of course like changing the path file name with file descriptors instead
Anonymous
Ah yes this one of course like changing the path file name with file descriptors instead
Tbh this is something I'd only expect to happen on Linux