THAT70sSHOW's blog

By THAT70sSHOW, 12 years ago, In English

Which of the two sequences is lexicographically smaller ?

A = { 11 ,11,17,61 }

B = { 3 , 3, 5,89 }

Source : Problem 10419 — Sum-up the Primes ( UVa Online Judge )

For 2 Sample which is correct A or B.
 Please Help.
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

B < A, because 3 < 11.

  • »
    »
    12 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I think so too , but in the question which is linked for sample case 2 , A is considered as lexicographical smaller than B

    • »
      »
      »
      12 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      OK, maybe you should compare strings (11+11+17+61 vs 3+3+5+89) instead of sequences in that task...