Click here to Skip to main content
15,890,043 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionScheduling with constraints Pin
jedraw3-Nov-23 5:23
jedraw3-Nov-23 5:23 
AnswerRe: Scheduling with constraints Pin
Gerry Schmitz3-Nov-23 6:08
mveGerry Schmitz3-Nov-23 6:08 
AnswerRe: Scheduling with constraints Pin
Richard MacCutchan3-Nov-23 6:40
mveRichard MacCutchan3-Nov-23 6:40 
GeneralRe: Scheduling with constraints Pin
jedraw3-Nov-23 6:55
jedraw3-Nov-23 6:55 
GeneralRe: Scheduling with constraints Pin
Richard MacCutchan3-Nov-23 7:06
mveRichard MacCutchan3-Nov-23 7:06 
QuestionRound-robin tournament scheduling, with teams that may share their home field Pin
Mad Bat30-Oct-23 7:00
Mad Bat30-Oct-23 7:00 
AnswerRe: Round-robin tournament scheduling, with teams that may share their home field Pin
Gerry Schmitz30-Oct-23 7:25
mveGerry Schmitz30-Oct-23 7:25 
QuestionAlgorithm Sequence Programming Competition Pin
Member 1612077221-Oct-23 3:38
Member 1612077221-Oct-23 3:38 
Recently, I joined a programming competition and stumble across a question that i consider difficult to answer because I cant even fully understand the problems given, to me this is the hardest question in the competition.
The problem goes like this :

You are given an integer k>0 and a series of k+2 numbers n[1], n[2], …, n[k+2]. You are told
that the numbers in the series are calculated using an equation of the following form for n>0:
n[x] = ((x + a[1]) * (x + a[2]) * (x + a[3]) ... (x + a[k])) / d

You do not know the value of d. You do not know the values for a[1] ... a[k]. You only know
that each (a[i] ≥ 0) and (d > 0) and you can assume that the product in the numerator is evenly
divisible by the integer value d. You can assume that the numerator can be represented by a
32-bit integer. But you know that the formula for n[x] is a polynomial function of degree k and
you know the value of k+2 points for this function. Based on this information, you actually have
enough information to calculate the next number n[k+3] in the sequence! This is your task.
Input
The first line will contain a single positive integer by itself that represents the value k. The
second line will consist of (k+2) integer values separated from each other by a single space.
The values on the second line represent the series n[1] through n[k+2].
The input must be read from standard input.
Output
The output of program should display a single integer on a line by itself representing the value
for n[k+3].
The output must be written to standard output.

Sample Input #1
First Line : 1
Second Line : 3 4 5

Output : 6

Sample Input #2
First Line : 2
Second Line : 1 3 6 10

Output : 15

I dont even understand why this problem is solvable when there is an unknown variable(d) and another function in the sequence(a[x]) and how to get the value of n(k+3)
AnswerRe: Algorithm Sequence Programming Competition Pin
Gerry Schmitz21-Oct-23 7:42
mveGerry Schmitz21-Oct-23 7:42 
AnswerRe: Algorithm Sequence Programming Competition Pin
Mircea Neacsu21-Oct-23 12:26
Mircea Neacsu21-Oct-23 12:26 
GeneralRe: Algorithm Sequence Programming Competition Pin
Member 1612077221-Oct-23 16:58
Member 1612077221-Oct-23 16:58 
AnswerRe: Algorithm Sequence Programming Competition Pin
Mircea Neacsu21-Oct-23 19:48
Mircea Neacsu21-Oct-23 19:48 
GeneralRe: Algorithm Sequence Programming Competition Pin
Gerry Schmitz22-Oct-23 9:05
mveGerry Schmitz22-Oct-23 9:05 
QuestionCollision Response in a RTS game, still trying to figure it out. Pin
Calin Negru23-Sep-23 7:32
Calin Negru23-Sep-23 7:32 
AnswerRe: Collision Response in a RTS game, still trying to figure it out. Pin
Gerry Schmitz23-Sep-23 7:48
mveGerry Schmitz23-Sep-23 7:48 
GeneralRe: Collision Response in a RTS game, still trying to figure it out. Pin
Calin Negru23-Sep-23 22:21
Calin Negru23-Sep-23 22:21 
AnswerRe: Collision Response in a RTS game, still trying to figure it out. Pin
Member 1614278528-Nov-23 6:53
Member 1614278528-Nov-23 6:53 
AnswerRe: Does D correctly simulated by H terminate normally? Pin
Richard MacCutchan16-May-23 22:05
mveRichard MacCutchan16-May-23 22:05 
GeneralRe: Does D correctly simulated by H terminate normally? Pin
Richard Deeming16-May-23 22:52
mveRichard Deeming16-May-23 22:52 
GeneralRe: Does D correctly simulated by H terminate normally? Pin
Dave Kreskowiak17-May-23 3:18
mveDave Kreskowiak17-May-23 3:18 
GeneralRe: Does D correctly simulated by H terminate normally? Pin
Dave Kreskowiak17-May-23 4:07
mveDave Kreskowiak17-May-23 4:07 
GeneralRe: Does D correctly simulated by H terminate normally? Pin
Dave Kreskowiak17-May-23 6:22
mveDave Kreskowiak17-May-23 6:22 
GeneralRe: Does D correctly simulated by H terminate normally? Pin
Dave Kreskowiak17-May-23 6:35
mveDave Kreskowiak17-May-23 6:35 
GeneralRe: Does D correctly simulated by H terminate normally? Pin
Dave Kreskowiak17-May-23 6:44
mveDave Kreskowiak17-May-23 6:44 
GeneralRe: Does D correctly simulated by H terminate normally? Pin
Dave Kreskowiak17-May-23 6:54
mveDave Kreskowiak17-May-23 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.