100 Replies
in images:
...do you need help or are you waiting for someone to do it for you?
$details
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, and what you expect the result to be. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
is there a question here somewhere?
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/more like do it for me, because unfortunately I don't understand how to do it
and I need some kind of reference so I can deal with these tasks for the future alone
That's not really how it works
yeah you'll learn from someone helping you through doing this yourself, not doing it for you
we don't just do assignments for people
ok does anybody want to help me doing this with me?
that's why the channel exists
alright, can you? please
try it on your own, then when you get stuck ask about that specific part here
I stucked on the assignment itself
did you ask your teacher for clarification?
it's not assignment from school, I don't have a teacher to help me
where'd you get it from?
if you don't even know where to begin maybe start with a simpler assignment?
from voluntary seminar on the internet
will you help me or not?
once you explain where you're stuck, if i can figure it out then sure
i don't currently have time to figure it all out for you
what does the n mean?
is it the empty squares in the picture?
there are two
n
s referenced, which one are you talking about
for both it looks like their meaning is immediately explainedEach entry starts with a line with a number n (1 ≤ n ≤ 104), indicating the number of nodes to which you can send the data packetit says that n indicates number of nodes to which we can send the data packet and I don't understand what are those.
unless you're leaving out context then i don't either, because what you sent doesn't go into detail
but it doesn't look relevant to solving the problem
ahh ok
now I don't understand this paragraph:
latency is like a delay, right?
it explains what it means in the text
start of the second paragraph of "input"
i think you just need to read through the whole assignment, because it looks like it provides all the necessary information
@Jimmacle
I think I understand it more now after reading it precisely
but I still don't understand this
what is k = 3?
it tells you what
k
is in the very first line of the assignmentohh, the hell
i'm blind
sorry
sounds like you need to...
🤣
what is a slot in the picture?
what do you think it might be
well here is k = 3 and I don't find any association with it in the picture
is it the square?
I know it must look I'm totally dumb, maybe I am though
But I really have some understanding issues here, let me read it once again
@Jimmacle I don't want to bother you, but could you please explain the whole exercise in your own words?
i didn't read the whole exercise
but i see that in that example
k = 3
and the image shows chunks of 3 slots, so they're probably relatedyes I thought that too, but then I saw this:
read closely
that is not picture 2
oh my god, I'm so retar ded 😭
ok gimme a sec I will try to look at it once again
Now I don't understand why in picture 1 there are 12 slots and in picture 2,3 there are just 8 slots
what defines the amount of slots, is it the number n in input?
no, they are iterations of the schedule
there are an indeterminate number of them
you have a schedule with k slots that runs in a loop, you're basically trying to fit all of your node communication in such a way that none of them overlap
ahh so this is the basic schedule:
and the picture shows the loop
yes
ok now I also understand when schedule is valid or not
but now I don't understand the output, let me read it and tell you what I don't understand after
alright so this number 8:
means that k = 8 ?
that there are 8 slots/nodes in the schedule?
8 latencies?
re-read the part that describes the input format
it tells you exactly what each line means
you don't know how big the schedule is, because the point of the exercise is to find that value
If the automod keeps blocking your post because you're using a slur, don't try to evade the automod
I did that, I'm lost in the terms slot, node, schedule, latency, data packet
ok
so it doesn't work this way:
it might, that's what you have to find out
you need to find the largest schedule that can correctly fit the nodes
so the input for this:
was:
?
@Jimmacle
and why is "3" repeating in every schedule, but "6" in every second schedule, and "9" in every third schedule?
and not like this ^
because that is the fundamental problem you are trying to solve
if you treat the infinite loop of schedules as a flat line of cells, every node has to be N spaces away from itself where N is the latency
and no two nodes can share a space
OH OKAY
- so the node "6" has latency 6 ms, that means it is 6 nodes away in the loop
- the node "9" has latency 9 ms, that means it is 9 nodes away
- and the node "3" is on every third node
oh now I see the connection
okay but what do I do now knowing that
well, now you can start implementing the code to find that solution
assuming you fully understand what you're trying to accomplish
I don't
I still don't understand how I come from this input
4 7 3 2 9 6 5 7
to this output 3
i don't think you have to use every node, because otherwise that wouldn't be a valid solution
you just use as many nodes as possible without breaking the rules defined by the problem
I still don't understand
can you just demonstrate the solution process on this input:
4 7 3 2 9 6 5 7
?try solving it on paper
yeah I'm trying to do that for 2 hours now
I don't know how
so the example solution gives you part of it, you know that the schedule will be 3 slots so you'll have to pick 3 numbers from that list
then arrange them so that they don't overlap in future schedules
ok
I'll try to draw it on paper
is the picking of 3 numbers just a trial and error?
or is there some key to picking those 3 numbers
brute forcing it is one solution, i don't know if it expects you to find a more optimized strategy
but that means I will have to try every combination of 3 numbers out of those 8 and also every arrange combination?
to brute force it, yes
and do you know the non-bruteforcing method?
no
i'm not a math guy, but it seems like it's ultimately a math problem
ok but with brute forcing there are thousands if not millions of combinations
no there aren't
you can calculate exactly how many possible combinations there are
you have 8 numbers to choose and 3 slots, so
8 * 7 * 6
possible combinationsbut also the arrange combinations
the correct order
that calculation includes that possibility
there are 336 ways to select and arrange 3 numbers from that set
even if you didn't know the final
k
was 3, you have a hard upper limit on the size of k
per the problem definition that says each slot in the first schedule must be filled, and a node can only appear in a schedule once
so k
cannot be larger than the smallest latency you chooseok and if there are 100 numbers to choose from the input?
that's why you're writing a program to solve it
there could be actually
it's 10**4
does the order of those 3 picked numbers matter?
or was this just a coincidence that they didn't overlap
yes, the order matters to find the best solution
if you didn't already know how big
k
was you wouldn't know if this is the best solutionand how do I even do it if I don't know how big is k ?
My simple question to you is:
How do I get the k =
3
from 4 7 3 2 9 6 5 7
?
Just on paper with pen
what is the process of solving itthe entire goal of the assignment is to find the biggest possible
k
yes
what is the context for this assignment?
because this isn't what i'd consider "easy"
Those who did it considered it as easy
which is why i'm curious what context this assignment was given under
what kind of class/program is this for?
it is voluntary seminar for high school students to practice their programming skills
I asked those who did it and they answered that it was very easy and that it took them only 60 lines of code
why not ask them to explain it to you?
I did but they answer like once per half an hour
Do you understand the task yourself?
or like know how to do it?
i would have to actually sit down and dedicate time to solving it
and i'm currently at work
i understand the goal, i don't have a complete solution off the top of my head
yeah ok
after this all time trying to understand and not knowing how to solve a task considered "EASY"
I'm no longer thinking about programming as my future job
I'm not sure if this is what I would like to do
@Jimmacle I get it!
A)
4 7 3 2 9 6 5 7
here the biggest k is 3 because the numbers are: 3, 6, 9
B)
1 2 2 3 3 4 4 4 8 9
here the biggest k is 4 because the numbers are: 4, 4, 4, 8
C)
5 5 5 5 5 5 5 5 5 5
here the biggest k is 5 because the numbers are: 5, 5, 5, 5, 5
I can explain to you why it is like that and you will tell me the procedure of the solution and then we can type the code.
@Jimmacle
I have the code! 🥳
I helped myself with ChatGPT but I got it.
It works! at least on the example inputs and outputs...this was never C#? you solved it at least
It was C# all along.
ChatGPT just started writing code in Python so I sticked to it for this task 😅
Thank you for helping me understand it!
The program doesn't work for those extra large inputs. But it works for the small ones, at least something.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.