Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 17408

Questions about problems that entail selecting the best element from some set of available alternatives, and methods to solve them.

1
vote
Imagine you have a 256 bit vector floating point unit which can perform eight 32 bit operations in parallel. How many operations per second can you perform with or without using the vector FPU? Imagi …
answered Mar 14 by gnasher729
1
vote
Polynomial time is not too difficult. A "cluster" contains a sequence of 1 or more consecutive numbers from your list. The "badness" of a cluster is defined as the sum of absolute differences betwee …
answered Jan 28 '18 by gnasher729
4
votes
There's a rather simple algorithm for this. You start at the end of the array, day 10. If you only wanted to travel from that day onwards, you could buy a 1 day, 7 day, or 30 day ticket. 1 day is op …
answered Jun 21 '16 by gnasher729
2
votes
Assume you start at zero. Lion #i is at $d_i$ and wakes up at $w_i$. If there is no lion with $d_i > 0$ and $w_i < d_i$ then you walk to the right and are safe. If there is no lion with $d_i < 0$ and …
answered Nov 17 '18 by gnasher729
0
votes
You can also replace with if (loop_condition) { loop_invariant_code do { loop_body } while (loop_condition) } With all he precautions of course. That makes the loop a bit simple …
answered Apr 27 by gnasher729
3
votes
Assume no method is free: If some methods are free, you try all the free methods first obviously, and you are left with a problem without free methods. Assume you have only n = 2 methods. Method 1 c …
answered Aug 6 '16 by gnasher729
1
vote
At any point in time, you have either (a) not bought anything, (b) bought stock once, (c) bought and sold stock once, (d) bought and sold, then bought again, (e) bought and sold twice. In each case yo …
answered Jul 17 '16 by gnasher729
0
votes
You could answer the question "what is the highest number of boxes that we can lift starting at box #k", for k = N, N-1, N-2, ..., 1 in that order. For k = N the answer is obviously 1, and for every …
answered Dec 3 '16 by gnasher729
0
votes
Problem definition: There are k ≥ 1 bids. Each bid $B_i$ consists of a price $p_i$ and a set $X_i$ of integers. A subset S of the integers 1 to k is acceptable if $X_i$ and $X_j$ have no element in co …
answered Aug 23 '16 by gnasher729
1
vote
In practice, just as you can calculate g (u) for one particular u quite quickly, you can calculate g (u) for all $u \in V$ in parallel, operating with bit vectors of $|V|$ bits instead of boolean valu …
answered Aug 28 '16 by gnasher729
1
vote
Algorithm: Pick girl #i where $P_i$ is as high as possible. Eligible boys are those with $A_j ≥ P_i ≥ B_j$. If there is no eligible boy then she is not matched, otherwise match her with eligible boy # …
answered Nov 6 '17 by gnasher729
2
votes
If you could solve the decision problem (do these items fit in k bins) you can obviously solve the optimisation problem (what is the minimum number of bins) using binary search. But you actually want …
answered May 29 by gnasher729
-1
votes
If you want to calculate the product of n matrices $A_1$ to $A_n$ in the best possible time, you can easily calculate how many operations are needed to calculate the product of $A_i$ to $A_j$ for all …
answered Jan 24 '17 by gnasher729
0
votes
I think this should be doable in O (n). Take the similar problem: Given $a_i$, 1 ≤ i ≤ n, and d ≥ 0, find $b_i$ in non-descending order such that $|a_i - b_i| ≤ d$ for all i, or show that it isn't p …
answered Apr 12 '18 by gnasher729
2
votes
For a list of fractions, define the ratio as (sum of numerator) / (sum of denominator). Question: Can we find a list of k fractions with the ratio ≥ r, for some given r? Let the sum of numerators b …
answered May 10 by gnasher729

15 30 50 per page