Anonymous
Anonymous
Not "if someone replies"
Anonymous
It's just a time wasting
Anonymous
Anonymous
Yes, it's ok
Using paste services
Roshan
Is it okay to paste <100 lines of code here please?
Manav
Use del.dog or hastebin.com
Manav
It's just an FAQ about what developers expect you to do when asking questions online
Anonymous
Anonymous
Bruh such arrogant ppl
Roshan
Yes
Thankyou pasting it here....
Anonymous
Manav
Yes
I think they'll paste the code here as text messages
Anonymous
Roshan
https://paste.ubuntu.com/p/rfcJyW5P9R/
Roshan
Is it done like this?
Anonymous
Anonymous
Anonymous
Xudoyberdi
Anonymous
/warn screen photo
Anonymous
For two integer arrays, the comparator value
is the total number of elements in the first
array such that there exists no integer in the
second array with an absolute difference
less than or equal to d. Find the comparator
value.
For example there are two arrays a = [7,5,
9), b = [ 13, 1, 4), and the integer d = 3. The
absolute difference of a[0] to b[0] = / 7 - 13
7 = 6, b[1] = / 7-1 ) = 6, and b[2] = / 7-4/
= 3, to recap, the values are 6, 6, 3. In this
case, the absolute difference with b[2] is
equal to d = 3, so this element does not
meet the criterion. A similar analysis of a[1]
= 5 yields absolute differences of 8, 4, 1 and
of a[2] = 9 yields 4, 8, 5. The only element of
a that has an absolute difference with each
element of b that is always greater than dis
element a[2], thus the comparator value is
1.
Can someone help mee
Manav
Roshan
Manav
@Roshan_Pradhan1098 implement this, in a naive implementation, you would have to check N(2N-1) ranges, where N is the no of students
Anonymous
thanks!
Roshan
Thankyou for all of this Manav and Danya!! I'll check what's the problem😄
Manav
Your method will only work if all the ranges coincides
Tostisto
Hey can anyone advise me how to start with this task? I need to create a timer in the console that will be represented by a 2D array. The timer will run for only a minute ....
Manav
Pavel
Pavel
And for the second line segment coordinate (the first one in the center) you can calculate it from the angle
https://math.stackexchange.com/questions/180874/convert-angle-radians-to-a-heading-vector
Tostisto
Masha8899
need help
Write a program that gives a discount of 100 pesos to a customer if the shirt
bought is XL and the price is greater than 500 pesos; a discount of 50 pesos if
the shirt bought is L and the price is greater than 400.
Masha8899
Masha8899
im having problem adding the size in my code
hdjdjdjjdj
you can scanf() the sizes as well
hdjdjdjjdj
and then add if or switch() statements to determine whether you will give a discount or not
Masha8899
Masha8899
also im having else without a previous if error
Roshan
@usernamestring
Roshan
I've changed the code for simplicity please review if it will work for all test cases (That Love for Maths question)
Roshan
https://hastebin.com/anesegihaz.cpp
Roshan
Let me share results....
Roshan
Roshan
olli
are you actually printing this?
cout << "Books: " << books << endl << endl;
cout << "Happy students: ";
for (auto i = satisfied.begin(); i != satisfied.end(); i++) {
cout << *i << " ";
}
Roshan
olli
Roshan
It will hang my phone probably
Roshan
But it takes much time....
Георгий
Roshan
Could you please make your own code and try it in Dcoder app
Roshan
I see many people in internet asking this same question but nobody has a perfect solution in c++
Roshan
Everyone getting 1/3 test cases correct 🙁
Георгий
Sai
How to split string and store them in an array.?
Roshan
String sth = "sth";
char x[3];
x[0] = sth[0];
(use loops)
Similarly...
olli
But it takes much time....
exactly my point. A lot of sites "fail" if your code takes more than a second to execute
su
Mino
Hi everybody, Is there someone that could help me ? I don't know how can comment directly a code with C++ compiler online (which bottom on my keyboard). I don't want know how can do an comment, because I know (// or */ for multiple). But I want comment all code with something bottom in my keyboard for example I saw that more people use ALT+SHIFT+C but Doesn't work on my key ...
Talula
Roshan
Mino
ok perfect resolved it
Mino
ctl+/
Roshan
Manav
Roshan
Manav
1/3 correct
Do you understand what that problem is asking of you? If even one test case evaluates to false, your implementation or the algorithm is incorrect