423,688 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,688 IT Pros & Developers. It's quick & easy.

que teorías o tecnologías me recomiendan para enfrentar este tipo de problemas?

P: 4
hello people good afternoon
There will be a mathematical theorem that allows solving the problem k: "surveillance" of icpc 2014. What theories or technologies around programming in java recommend me to face this type of problems?






import java.util.ArrayList;

public class Integers {

private ArrayList<Integer> numbers;

public Integers(int a, int b, int limit) {//constructor
this.numbers = new ArrayList<Integer>();

makeList(a, b, limit);
}

public void makeList(int a, int b, int limit) {
if (a < b) {
while (a <= b) {
this.numbers.add(a);
a++;
}
} else {

int aux = 1;
while (aux <= b) {
this.numbers.add(aux);
aux++;
}

int aux2 = a;
while (aux2 <= limit) {
this.numbers.add(aux2);
aux2++;
}

}
}

public void showNumbers() {
for (int x = 0; x < this.numbers.size(); x++) {
System.out.print(this.numbers.get(x) + "\t");
}

}
}
2 Weeks Ago #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.