Search Results

Search found 3240 results on 130 pages for 'groupwise maximum'.

Page 16/130 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Efficient algorithm to find a maximum common subset of two sets?

    - by datasunny
    Each set contains bunch of checksums. For example: Set A: { 4445968d0e100ad08323df8c895cea15 a67f8052594d6ba3f75502c0b91b868f 07736dde2f8484a4a3af463e05f039e3 5b1e374ff2ba949ab49870ca24d3163a } Set B: { 6639e1da308fd7b04b7635a17450df7c 4445968d0e100ad08323df8c895cea15 a67f8052594d6ba3f75502c0b91b868f } The maximum common subset of A and B is: { 4445968d0e100ad08323df8c895cea15 a67f8052594d6ba3f75502c0b91b868f } A lot of this operations will be performed, so I'm looking for an efficient algorithm to do so. Thanks for your help.

    Read the article

  • Finding the maximum weight subsequence of an array of positive integers?

    - by BeeBand
    I'm tring to find the maximum weight subsequence of an array of positive integers - the catch is that no adjacent members are allowed in the final subsequence. The exact same question was asked here, and a recursive solution was given by MarkusQ. He provides an explanation, but can anyone help me understand how he has expanded the function? How does this solution take into consideration non-adjacent members?

    Read the article

  • What's the maximum number of operators you that can be used in an if statement?

    - by DMinGod
    Hi, i'm using jquery and I'm trying to validate a form. My question is - What is the maximum number of tests can you give in a single if statement. function cc_validate () { if ($("#name").val() == "" || $("#ship_name").val() == "" || $("#address").val() == "" || $("#city").val() == "" || $("#ship_city").val() == "" || $("#state").val() == "" || $("#ship_state").val() == "" || $("#postal_code").val() == "" || isNaN($("#postal_code").val()) || $("#phone").val() == "" || $("#ship_phone").val() == "" || isNaN($("#phone").val()) || isNaN($("#ship_phone").val()) || $("#mobile_number").val() == "" || $("#ship_mobile_number").val() == "" || isNaN($("#mobile_number").val()) || isNaN($("#ship_mobile_number").val()) || $("#email").val() == "") { return false; } else { return true; } }

    Read the article

  • How to select product that have the maximum price of each category?

    - by kimleng
    The below is my table that has the item such as: ProductId ProductName Category Price 1 Tiger Beer $12.00 2 ABC Beer $13.99 3 Anchor Beer $9.00 4 Apolo Wine $10.88 5 Randonal Wine $18.90 6 Wisky Wine $30.19 7 Coca Beverage $2.00 8 Sting Beverage $5.00 9 Spy Beverage $4.00 10 Angkor Beer $12.88 And I suppose that I have only three category in this table (I can have a lot of category in this table). And I want to show the maximum product's price of each category in this table.

    Read the article

  • What's the actual windows media player maximum banner width?

    - by William
    When looking at the documentation for the banner tag in windows media metafiles all the documentation says there is a maximum size of 194 x 32 pixels. http://msdn.microsoft.com/en-us/library/dd562478(v=VS.85).aspx However, when experimenting with larger images they seem to be displaying correctly. Is there some real undocumented limitation here? Will it get cut off on different/older versions?

    Read the article

  • How to find minimum weight with maximum cost in 0-1 Knapsack algorithm?

    - by Nitin9791
    I am trying to solve a spoj problem Party Schedule the problem statement is- You just received another bill which you cannot pay because you lack the money. Unfortunately, this is not the first time to happen, and now you decide to investigate the cause of your constant monetary shortness. The reason is quite obvious: the lion's share of your money routinely disappears at the entrance of party localities. You make up your mind to solve the problem where it arises, namely at the parties themselves. You introduce a limit for your party budget and try to have the most possible fun with regard to this limit. You inquire beforehand about the entrance fee to each party and estimate how much fun you might have there. The list is readily compiled, but how do you actually pick the parties that give you the most fun and do not exceed your budget? Write a program which finds this optimal set of parties that offer the most fun. Keep in mind that your budget need not necessarily be reached exactly. Achieve the highest possible fun level, and do not spend more money than is absolutely necessary. Input The first line of the input specifies your party budget and the number n of parties. The following n lines contain two numbers each. The first number indicates the entrance fee of each party. Parties cost between 5 and 25 francs. The second number indicates the amount of fun of each party, given as an integer number ranging from 0 to 10. The budget will not exceed 500 and there will be at most 100 parties. All numbers are separated by a single space. There are many test cases. Input ends with 0 0. Output For each test case your program must output the sum of the entrance fees and the sum of all fun values of an optimal solution. Both numbers must be separated by a single space. Example Sample input: 50 10 12 3 15 8 16 9 16 6 10 2 21 9 18 4 12 4 17 8 18 9 50 10 13 8 19 10 16 8 12 9 10 2 12 8 13 5 15 5 11 7 16 2 0 0 Sample output: 49 26 48 32 now I know that it is an advance version of 0/1 knapsack problem where along with maximum cost we also have to find minimum weight that is less than a a given weight and have maximum cost. so I have used dp to solve this problem but still get a wrong awnser on submission while it is perfectly fine with given test cases. My code is typedef vector<int> vi; #define pb push_back #define FOR(i,n) for(int i=0;i<n;i++) int main() { //freopen("input.txt","r",stdin); while(1) { int W,n; cin>>W>>n; if(W==0 && n==0) break; int K[n+1][W+1]; vi val,wt; FOR(i,n) { int x,y; cin>>x>>y; wt.pb(x); val.pb(y); } FOR(i,n+1) { FOR(w,W+1) { if(i==0 || w==0) { K[i][w]=0; } else if (wt[i-1] <= w) { if(val[i-1] + K[i-1][w-wt[i-1]]>=K[i-1][w]) { K[i][w]=val[i-1] + K[i-1][w-wt[i-1]]; } else { K[i][w]=K[i-1][w]; } } else { K[i][w] = K[i-1][w]; } } } int a1=K[n][W],a2; for(int j=0;j<W;j++) { if(K[n][j]==a1) { a2=j; break; } } cout<<a2<<" "<<a1<<"\n"; } return 0; } Could anyone suggest what am I missing??

    Read the article

  • Android: How to set the maximum size of a Spinner?

    - by Epaga
    Here is my layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:id="@+id/LinearLayout01" android:layout_height="wrap_content"> <Spinner android:text="@+id/AutoCompleteTextView01" android:id="@+id/Spinner01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="130dp"></Spinner> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/Chapter" android:width="30dp"></EditText> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TextView01" android:text=":"></TextView> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/Verse" android:width="40dp"></EditText> </LinearLayout> I inflate this layout as an AlertDialog's view. But when I pick a large element, the text fields get pushed out to the right. Is there any way to set the maximum size of the spinner so after choosing an element, it shortens the choice with an ellipsis ("...") or something?

    Read the article

  • What is the maximum distance from an anchor point to a bezier curve?

    - by drawnonward
    Given a cubic bezier curve P0,P1,P2,P3 with the following properties: • Both P1 and P2 are on the same side of the line formed by P0 and P3. • P2 can be projected onto the line segment formed by P0 and P3 but P1 cannot. What is the T value for the point on the curve farthest from P3? Here is an image with an example curve. The curve bulges on the left, so there is a point on the curve farther from P3 than P0. I found this reference for finding the minimum distance from an arbitrary point to a curve. Is trial and error the only way to solve for maximum distance as well? Does it make any difference that the point is an anchor on the curve? Thanks

    Read the article

  • What is the maximum number of virtualhosts Apache can handle?

    - by FractalizeR
    Hello. What is the maximum number of VirtualHosts Apache can handle on a single machine (I don't mean anything related to load, let's suppose it's irrelevant for the question). And we take only Apache without any proxifying things like nginx. I am asking because on one forum one guy reported that his Apache works unstable with the number of sites more than 400 on a single machine. If you have a config, that handles more than 400, please tell me here. Thanks.

    Read the article

  • maximum string length quota error consuming WCF webservice from Biztalk.

    - by TygerKrash
    I'm getting this error message "The Maximum string content length quota (8192) has been exceeded while reading XML data. This quotea may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader" In the one of my orchestrations that consumes a wcf webservice (stacktrace indicates the receive shape is where the issue is), It is likely that the response is very large. looking at some of the other questions with this error message the solution is to change a WCF bindings setting in the configuration file. However I can't find these configuration settings when I'm using biztalk. They don't seem to be generated anywhere, should I be trying to add them to BTSNTSVc.exe.config. Any suggestions welcome.

    Read the article

  • How to find the maximum value for each key in a List of Dictionaries using LINQ?

    - by Argos
    I have a List of Dictionaries that have keys of type string and values that are ints. Many of the dictionaries have the same keys in them but not all of them. So my question is: using LINQ how would I find the maximum value associated with each distinct key across all of the dictionaries? So for example given the following input: var data = new List<Dictionary<string, int>> { new Dictionary<string, int> {{"alpha", 4}, {"gorilla", 2}, {"gamma", 3}}, new Dictionary<string, int> {{"alpha", 1}, {"beta", 3}, {"gamma", 1}}, new Dictionary<string, int> {{"monkey", 2}, {"beta", 2}, {"gamma", 2}}, }; I would like some kind of collection that contains: {"alpha", 4}, {"gorilla", 2}, {"gamma", 3}, {"beta", 3}, {"monkey", 2} (I'm currently looping through the list and keeping track of things myself, really just wondering if there is a nicer LINQ-esque way of doing it) EDIT: I also don't know what the string keys are in advance

    Read the article

  • How to add characters to reach the maximum size of a char[].

    - by Bon_chan
    Hi folks, I have the following part of code : for(int i=0;i<n;i++) { printf("Student %d\n",i+1); printf("Enter name : "); scanf("%s",&(student+i)->name); fflush(stdin); lengthName = strlen((student+i)->name); while(lengthName !='\0') { }} when the length is shorter than 10, it will add hyphens until reaching the maximum size. Ex : John = 6 hyphens will be added I know how to do it in csharp but can't figure it out in c. Could some of you give me some lights please? PS : Oh yes the variable name is char name[10+1] and it a part of the structure called student.

    Read the article

  • How to get maximum/largest value from json object with Android?

    - by blankon91
    I've json string like this: {"GetReportResult":[ {"bulan":"4","total":"2448","type":"CHEESE1K","uang":"8847823"},{"bulan":"4","total":"572476","type":"ESL","uang":"5863408410"},{"bulan":"4","total":"46008","type":"ESL500ML","uang":"234498301"},{"bulan":"4","total":"228985","type":"UHT","uang":"1367172990"},{"bulan":"4","total":"40995","type":"WHP","uang":"235750452"},{"bulan":"5","total":"5703","type":"CHEESE1K","uang":"134929306"},{"bulan":"5","total":"648663","type":"ESL","uang":"6645764498"},{"bulan":"5","total":"49305","type":"ESL500ML","uang":"266817346"},{"bulan":"5","total":"287867","type":"UHT","uang":"1446897805"},{"bulan":"5","total":"51958","type":"WHP","uang":"631994613"},{"bulan":"6","total":"4390","type":"CHEESE1K","uang":"104527773"},{"bulan":"6","total":"443335","type":"ESL","uang":"4540123082"},{"bulan":"6","total":"28462","type":"ESL500ML","uang":"148290912"},{"bulan":"6","total":"213250","type":"UHT","uang":"1197646870"},{"bulan":"6","total":"27049","type":"WHP","uang":"189802525"} ]} I want to get maximum/largest value of bulan, which is 6. How to do that on android?

    Read the article

  • In SQL how do I get the maximum value for an integer?

    - by CoffeeMonster
    Hi, I am trying to find out the maximum value for an integer (signed or unsigned) from a MySQL database. Is there a way to pull back this information from the database itself? Are there any built-in constants or functions I can use (either standard SQL or MySQL specific). At http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html it lists the values - but is there a way for the database to tell me. The following gives me the MAX_BIGINT - what I'd like is the MAX_INT. SELECT CAST( 99999999999999999999999 AS SIGNED ) as max_int; # max_int | 9223372036854775807 Thanks in advance,

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >