Never Spam Bot
See spam? Quote it and send /spam
That helps to block spammers who joined the group before the bot was added.
Rose
Purge complete.
hlebyshek
Dipanshu
Dipanshu
大宝剑
大宝剑
then you can get an object that supports almost any language
Ziky
sure. therefore ı gotta turn them to struct someway
Well you can make set of functions in cpp file defined with extern "C" accessing your objects. You can use void pointer to point to your objects. But avoid mixing c++ with C if you can...
onz
harmony5 🇺🇳 ⌤
No
Ибраги́м
The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software
http://gotw.ca/publications/concurrency-ddj.htm
Shadab
Hi everyone
大宝剑
is turning classes to struct called COM ?
no,you can create a ATL project in visual studio, then add a 'ATL simple object'
大宝剑
https://learn.microsoft.com/en-us/cpp/atl/introduction-to-com-and-atl?view=msvc-170
Kishan Kumawat
\n
Anubhav
Hi
Simple Sorcerer
Hi
nohello.com
go to C++ OT ( oftopic )
Rose
Purge complete.
Yorhane
Good afternoon, one question, what teachers specialize into talk about programming focus on in telephony?
Yorhane
Or contents
大宝剑
Can't
I am stuck in the code of sum of factorials in cpp using structure
浩
浩
Mahi
Hello
Mahi
I'm new here
Dmitriy
Hey folks, I'm install vs code , but he doesn't work, Ms vs set , gcc and clang set what wrong with him?
Dmitriy
I'm used code block
NAITRO
Simple Sorcerer
Simple Sorcerer
Or you can write the code in vs code. Install the compiler, CMake and Makefile
stranger
Can anyone help me with this problem. I am stuck on it for some time. It was asked to a friend in an interview but he couldn't solve it. Neither am I able to solve it.
You are given an array A of length N. You also have an empty array B that is filled as follows:
• You can add elements either at the beginning or at the end of B.
• The elements of A are sequentially added to the initially empty B, starting with A[0] and finishing with A[N-1].
Find the minimum number of inversions possible in B after all elements from A are added. Since the answer can be very large return it modulo 10^9+7.
Note:
• An inversion in an array A is a pair of indices (i, j) such that i < j and A[i] > A[j].
• It is given that both arrays follow 0- based indexing.
The first line contains an integer, N, denoting the number of elements in A
Each line i of the N subsequent lines (where 0 s i < N) contains an integer describing A[i].
Constraints
1 <= N <= 10^5
-10^9 <= A[i] <= 10^9
Sample Test Cases
Case 1
Input:
3
3
1
2
Output:
1
Here A=[3,1,2] B=[].
Add 3 at any side it doesn't matter B=[3]
A=[1,2]
Add 1 at beginning of B, B=[1,3] A=[2].
Add 2 at end of B, B=[1,3,2] A=[].
Inversion in B-1 which is of pair at indexes (1,2) here we are taking 0-based indexing
Case 2
Input:
5
-1
3
-6
-5
-4
Output:
3
Explanation:
Here A=[-1,3,-6,-5,-4] B=[].
Add -1 at any side it doesn't matter B=[-1]
A=[3,-6,-5,-4]
Add 3 at end of B, B=[1,3] A=[-6,-5,-4].
Add -6 at start of B, B=[-6,-1,3] A=[-5,-4].
Add -5 at start of B, B=[-5,-6,-1,3] A=[-4].
Add -4 at start of B, B=[-4,-5,-6,-1,3] A=[]
This is what I tried but got TLE
I did something like this.
FUNCTION min_inversions(A):
MOD = 10^9 + 7
N = LENGTH(A)
CREATE dp ARRAY OF SIZE N x 2 INITIALIZED TO 0
CREATE count_greater ARRAY OF SIZE N INITIALIZED TO 0
CREATE count_smaller ARRAY OF SIZE N INITIALIZED TO 0
FOR i FROM 1 TO N-1:
FOR j FROM 0 TO i-1:
IF A[j] > A[i]:
count_greater[i] += 1
ELSE IF A[j] < A[i]:
count_smaller[i] += 1
dp[i][0] = MIN(dp[i-1][0] + count_greater[i], dp[i-1][1] + count_greater[i])
dp[i][1] = MIN(dp[i-1][0] + count_smaller[i], dp[i-1][1] + count_smaller[i])
RESULT = MIN(dp[N-1][0], dp[N-1][1]) % MOD
RETURN RESULT
Never Spam Bot
𝐊𝐞𝐢𝐭𝐡 𝐖. 𝐌𝐨𝐨𝐫𝐞 sent multiple messages that looks like a spam.
Write something about yourself below this message. If I see that you are human, your messages will no longer be deleted.
Spam deleted in this group: 954
See spam? Quote it and send /spam
Can't
\Device\NUL
浩
Any other solution?
auto f(int n) {int v = 1; int s = 0; for(auto i = 1; i <= n; i++) {s += v; v *= i;} return s;}
Simple Sorcerer
Simple Sorcerer
and "```"
Rose
Welcome Money!
Please read the pinned message 🙂
Click the button below to unmute yourself.
ADITYA
Hello
ADITYA
I need help
ADITYA
Can anyone suggest me the ide for the c and the c++ I am a new coder please suggest IDE
klimi
ADITYA
Προμηθεύς
Προμηθεύς
ADITYA
Cmd
ADITYA
Have you used the linux
NAITRO
Can me install Linux on virtual box
ADITYA
ADITYA
Do we need to study the c and c++ programming book
ADITYA
I am using turboc++
ADITYA
As I am new to code
ADITYA
I am following a youtube channel name codeitup he is teaching the c++ in the turbo c++ named ide then it will be move to the code block ide
ADITYA
After that I will try some projects in c++
ADITYA
do DSA also
imminent
just use visual studio, vs code with msvc, clang, gcc whatever
ADITYA
Not doing spam
Numa
Hi everyone, just wanted to ask if anyone knows how to integrate a smartwatch to a website? I need to fetch the health data from the watch and present it in my website.
大宝剑
大宝剑
Your smartwatch should allow you to run some code, such as an Android APK where you can call libcurl or something like that to communicate with an http server
BTS
Hey everyone
BTS
Hi
BTS
No one here
BTS
?
klimi
No one here
did you really expect that for your silly "hi" more than 16 thousands of people will respond? you are wasting everyone's time...
\Device\NUL
Cmd
Cmd isn't console. It's conhost
ADITYA
Should I use the eclipse ide for c c++