Hex Artifact Content
Not logged in

Artifact 7ca249caa65bea302e9180a95777e2487655ab4b:


0000: 23 69 6e 63 6c 75 64 65 20 3c 69 6f 73 74 72 65  #include <iostre
0010: 61 6d 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 73  am>..#include <s
0020: 73 74 72 65 61 6d 3e 0d 0a 23 69 6e 63 6c 75 64  stream>..#includ
0030: 65 20 3c 69 6f 6d 61 6e 69 70 3e 0d 0a 23 69 6e  e <iomanip>..#in
0040: 63 6c 75 64 65 20 3c 76 65 63 74 6f 72 3e 0d 0a  clude <vector>..
0050: 23 69 6e 63 6c 75 64 65 20 3c 73 74 72 69 6e 67  #include <string
0060: 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 6d 61 70  >..#include <map
0070: 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 73 65 74  >..#include <set
0080: 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 61 6c 67  >..#include <alg
0090: 6f 72 69 74 68 6d 3e 0d 0a 23 69 6e 63 6c 75 64  orithm>..#includ
00a0: 65 20 3c 6e 75 6d 65 72 69 63 3e 0d 0a 23 69 6e  e <numeric>..#in
00b0: 63 6c 75 64 65 20 3c 69 74 65 72 61 74 6f 72 3e  clude <iterator>
00c0: 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 66 75 6e 63  ..#include <func
00d0: 74 69 6f 6e 61 6c 3e 0d 0a 23 69 6e 63 6c 75 64  tional>..#includ
00e0: 65 20 3c 63 6f 6d 70 6c 65 78 3e 0d 0a 23 69 6e  e <complex>..#in
00f0: 63 6c 75 64 65 20 3c 71 75 65 75 65 3e 0d 0a 23  clude <queue>..#
0100: 69 6e 63 6c 75 64 65 20 3c 73 74 61 63 6b 3e 0d  include <stack>.
0110: 0a 23 69 6e 63 6c 75 64 65 20 3c 63 6d 61 74 68  .#include <cmath
0120: 3e 0d 0a 23 69 6e 63 6c 75 64 65 20 3c 63 61 73  >..#include <cas
0130: 73 65 72 74 3e 0d 0a 23 69 6e 63 6c 75 64 65 20  sert>..#include 
0140: 3c 63 73 74 72 69 6e 67 3e 0d 0a 75 73 69 6e 67  <cstring>..using
0150: 20 6e 61 6d 65 73 70 61 63 65 20 73 74 64 3b 0d   namespace std;.
0160: 0a 74 79 70 65 64 65 66 20 6c 6f 6e 67 20 6c 6f  .typedef long lo
0170: 6e 67 20 4c 4c 3b 0d 0a 74 79 70 65 64 65 66 20  ng LL;..typedef 
0180: 63 6f 6d 70 6c 65 78 3c 64 6f 75 62 6c 65 3e 20  complex<double> 
0190: 43 4d 50 3b 0d 0a 0d 0a 63 6c 61 73 73 20 41 6c  CMP;....class Al
01a0: 74 65 72 6e 61 74 69 6e 67 4c 61 6e 65 20 7b 20  ternatingLane { 
01b0: 70 75 62 6c 69 63 3a 0d 0a 09 64 6f 75 62 6c 65  public:...double
01c0: 20 65 78 70 65 63 74 65 64 42 65 61 75 74 79 28   expectedBeauty(
01d0: 76 65 63 74 6f 72 20 3c 69 6e 74 3e 20 6c 6f 77  vector <int> low
01e0: 2c 20 76 65 63 74 6f 72 20 3c 69 6e 74 3e 20 68  , vector <int> h
01f0: 69 67 68 29 20 0d 0a 09 7b 0d 0a 09 09 64 6f 75  igh) ...{....dou
0200: 62 6c 65 20 65 53 75 6d 20 3d 20 30 2e 30 3b 0d  ble eSum = 0.0;.
0210: 0a 09 09 66 6f 72 28 69 6e 74 20 69 3d 31 3b 20  ...for(int i=1; 
0220: 69 3c 6c 6f 77 2e 73 69 7a 65 28 29 3b 20 2b 2b  i<low.size(); ++
0230: 69 29 0d 0a 09 09 7b 0d 0a 09 09 09 2f 2f 20 83  i)....{.....// .
0240: 89 83 93 83 5f 83 80 82 c9 0d 0a 09 09 09 2f 2f  ...._.........//
0250: 20 20 20 68 20 81 b8 20 5b 6c 6f 77 5b 69 2d 31     h .. [low[i-1
0260: 5d 2c 20 68 69 67 68 5b 69 2d 31 5d 5d 0d 0a 09  ], high[i-1]]...
0270: 09 09 2f 2f 20 20 20 67 20 81 b8 20 5b 6c 6f 77  ..//   g .. [low
0280: 5b 69 5d 2c 20 20 20 68 69 67 68 5b 69 5d 20 20  [i],   high[i]  
0290: 5d 0d 0a 09 09 09 2f 2f 20 82 f0 8e e6 82 c1 82  ].....// .......
02a0: c4 82 ab 82 bd 82 c6 82 ab 82 cc 81 41 7c 68 2d  ............A|h-
02b0: 67 7c 20 82 cc 8a fa 91 d2 92 6c 81 63 0d 0a 09  g| .......l.c...
02c0: 09 09 64 6f 75 62 6c 65 20 65 20 3d 20 30 3b 0d  ..double e = 0;.
02d0: 0a 09 09 09 66 6f 72 28 69 6e 74 20 68 3d 6c 6f  ....for(int h=lo
02e0: 77 5b 69 2d 31 5d 3b 20 68 3c 3d 68 69 67 68 5b  w[i-1]; h<=high[
02f0: 69 2d 31 5d 3b 20 2b 2b 68 29 0d 0a 09 09 09 09  i-1]; ++h)......
0300: 69 66 28 20 68 20 3c 3d 20 6c 6f 77 5b 69 5d 20  if( h <= low[i] 
0310: 29 0d 0a 09 09 09 09 09 65 20 2b 3d 20 73 65 71  ).......e += seq
0320: 75 65 6e 63 65 53 75 6d 28 6c 6f 77 5b 69 5d 2d  uenceSum(low[i]-
0330: 68 2c 20 68 69 67 68 5b 69 5d 2d 68 29 3b 0d 0a  h, high[i]-h);..
0340: 09 09 09 09 65 6c 73 65 20 69 66 28 20 68 69 67  ....else if( hig
0350: 68 5b 69 5d 20 3c 3d 20 68 20 29 0d 0a 09 09 09  h[i] <= h ).....
0360: 09 09 65 20 2b 3d 20 73 65 71 75 65 6e 63 65 53  ..e += sequenceS
0370: 75 6d 28 68 2d 68 69 67 68 5b 69 5d 2c 20 68 2d  um(h-high[i], h-
0380: 6c 6f 77 5b 69 5d 29 3b 0d 0a 09 09 09 09 65 6c  low[i]);......el
0390: 73 65 0d 0a 09 09 09 09 09 65 20 2b 3d 20 73 65  se.......e += se
03a0: 71 75 65 6e 63 65 53 75 6d 28 30 2c 20 68 2d 6c  quenceSum(0, h-l
03b0: 6f 77 5b 69 5d 29 20 2b 20 73 65 71 75 65 6e 63  ow[i]) + sequenc
03c0: 65 53 75 6d 28 30 2c 20 68 69 67 68 5b 69 5d 2d  eSum(0, high[i]-
03d0: 68 29 3b 0d 0a 09 09 09 65 53 75 6d 20 2b 3d 20  h);.....eSum += 
03e0: 65 20 2f 20 28 68 69 67 68 5b 69 5d 2d 6c 6f 77  e / (high[i]-low
03f0: 5b 69 5d 2b 31 29 20 2f 20 28 68 69 67 68 5b 69  [i]+1) / (high[i
0400: 2d 31 5d 2d 6c 6f 77 5b 69 2d 31 5d 2b 31 29 3b  -1]-low[i-1]+1);
0410: 0d 0a 09 09 7d 0d 0a 09 09 72 65 74 75 72 6e 20  ....}....return 
0420: 65 53 75 6d 3b 20 2f 2f 20 81 63 82 cc 98 61 81  eSum; // .c...a.
0430: 41 82 aa 93 9a 82 a6 0d 0a 09 7d 0d 0a 0d 0a 09  A.........}.....
0440: 4c 4c 20 73 65 71 75 65 6e 63 65 53 75 6d 28 4c  LL sequenceSum(L
0450: 4c 20 61 2c 20 4c 4c 20 62 29 20 2f 2f 20 61 2b  L a, LL b) // a+
0460: 28 61 2b 31 29 2b 2e 2e 2e 2b 62 0d 0a 09 7b 0d  (a+1)+...+b...{.
0470: 0a 09 09 72 65 74 75 72 6e 20 28 61 2b 62 29 20  ...return (a+b) 
0480: 2a 20 28 62 2d 61 2b 31 29 20 2f 20 32 3b 0d 0a  * (b-a+1) / 2;..
0490: 09 7d 0d 0a 7d 3b 0d 0a 0d 0a 2f 2f 20 42 45 47  .}..};....// BEG
04a0: 49 4e 20 43 55 54 20 48 45 52 45 0d 0a 23 69 6e  IN CUT HERE..#in
04b0: 63 6c 75 64 65 20 3c 63 74 69 6d 65 3e 0d 0a 64  clude <ctime>..d
04c0: 6f 75 62 6c 65 20 73 74 61 72 74 5f 74 69 6d 65  ouble start_time
04d0: 3b 20 73 74 72 69 6e 67 20 74 69 6d 65 72 28 29  ; string timer()
04e0: 0d 0a 20 7b 20 6f 73 74 72 69 6e 67 73 74 72 65  .. { ostringstre
04f0: 61 6d 20 6f 73 3b 20 6f 73 20 3c 3c 20 22 20 28  am os; os << " (
0500: 22 20 3c 3c 20 69 6e 74 28 28 63 6c 6f 63 6b 28  " << int((clock(
0510: 29 2d 73 74 61 72 74 5f 74 69 6d 65 29 2f 43 4c  )-start_time)/CL
0520: 4f 43 4b 53 5f 50 45 52 5f 53 45 43 2a 31 30 30  OCKS_PER_SEC*100
0530: 30 29 20 3c 3c 20 22 20 6d 73 65 63 29 22 3b 20  0) << " msec)"; 
0540: 72 65 74 75 72 6e 20 6f 73 2e 73 74 72 28 29 3b  return os.str();
0550: 20 7d 0d 0a 74 65 6d 70 6c 61 74 65 3c 74 79 70   }..template<typ
0560: 65 6e 61 6d 65 20 54 3e 20 6f 73 74 72 65 61 6d  ename T> ostream
0570: 26 20 6f 70 65 72 61 74 6f 72 3c 3c 28 6f 73 74  & operator<<(ost
0580: 72 65 61 6d 26 20 6f 73 2c 20 63 6f 6e 73 74 20  ream& os, const 
0590: 76 65 63 74 6f 72 3c 54 3e 26 20 76 29 0d 0a 20  vector<T>& v).. 
05a0: 7b 20 6f 73 20 3c 3c 20 22 7b 20 22 3b 0d 0a 20  { os << "{ ";.. 
05b0: 20 20 66 6f 72 28 74 79 70 65 6e 61 6d 65 20 76    for(typename v
05c0: 65 63 74 6f 72 3c 54 3e 3a 3a 63 6f 6e 73 74 5f  ector<T>::const_
05d0: 69 74 65 72 61 74 6f 72 20 69 74 3d 76 2e 62 65  iterator it=v.be
05e0: 67 69 6e 28 29 3b 20 69 74 21 3d 76 2e 65 6e 64  gin(); it!=v.end
05f0: 28 29 3b 20 2b 2b 69 74 29 0d 0a 20 20 20 6f 73  (); ++it)..   os
0600: 20 3c 3c 20 27 5c 22 27 20 3c 3c 20 2a 69 74 20   << '\"' << *it 
0610: 3c 3c 20 27 5c 22 27 20 3c 3c 20 28 69 74 2b 31  << '\"' << (it+1
0620: 3d 3d 76 2e 65 6e 64 28 29 20 3f 20 22 22 20 3a  ==v.end() ? "" :
0630: 20 22 2c 20 22 29 3b 20 6f 73 20 3c 3c 20 22 20   ", "); os << " 
0640: 7d 22 3b 20 72 65 74 75 72 6e 20 6f 73 3b 20 7d  }"; return os; }
0650: 0d 0a 76 6f 69 64 20 76 65 72 69 66 79 5f 63 61  ..void verify_ca
0660: 73 65 28 63 6f 6e 73 74 20 64 6f 75 62 6c 65 26  se(const double&
0670: 20 45 78 70 65 63 74 65 64 2c 20 63 6f 6e 73 74   Expected, const
0680: 20 64 6f 75 62 6c 65 26 20 52 65 63 65 69 76 65   double& Receive
0690: 64 29 20 7b 0d 0a 20 62 6f 6f 6c 20 6f 6b 20 3d  d) {.. bool ok =
06a0: 20 28 61 62 73 28 45 78 70 65 63 74 65 64 20 2d   (abs(Expected -
06b0: 20 52 65 63 65 69 76 65 64 29 20 3c 20 31 65 2d   Received) < 1e-
06c0: 39 29 3b 0d 0a 20 69 66 28 6f 6b 29 20 63 65 72  9);.. if(ok) cer
06d0: 72 20 3c 3c 20 22 50 41 53 53 45 44 22 20 3c 3c  r << "PASSED" <<
06e0: 20 74 69 6d 65 72 28 29 20 3c 3c 20 65 6e 64 6c   timer() << endl
06f0: 3b 20 20 65 6c 73 65 20 7b 20 63 65 72 72 20 3c  ;  else { cerr <
0700: 3c 20 22 46 41 49 4c 45 44 22 20 3c 3c 20 74 69  < "FAILED" << ti
0710: 6d 65 72 28 29 20 3c 3c 20 65 6e 64 6c 3b 0d 0a  mer() << endl;..
0720: 20 63 65 72 72 20 3c 3c 20 22 5c 74 6f 3a 20 5c   cerr << "\to: \
0730: 22 22 20 3c 3c 20 45 78 70 65 63 74 65 64 20 3c  "" << Expected <
0740: 3c 20 27 5c 22 27 20 3c 3c 20 65 6e 64 6c 20 3c  < '\"' << endl <
0750: 3c 20 22 5c 74 78 3a 20 5c 22 22 20 3c 3c 20 52  < "\tx: \"" << R
0760: 65 63 65 69 76 65 64 20 3c 3c 20 27 5c 22 27 20  eceived << '\"' 
0770: 3c 3c 20 65 6e 64 6c 3b 20 7d 20 7d 0d 0a 23 64  << endl; } }..#d
0780: 65 66 69 6e 65 20 43 41 53 45 28 4e 29 20 7b 63  efine CASE(N) {c
0790: 65 72 72 20 3c 3c 20 22 54 65 73 74 20 43 61 73  err << "Test Cas
07a0: 65 20 23 22 20 3c 3c 20 4e 20 3c 3c 20 22 2e 2e  e #" << N << "..
07b0: 2e 22 20 3c 3c 20 66 6c 75 73 68 3b 20 73 74 61  ." << flush; sta
07c0: 72 74 5f 74 69 6d 65 3d 63 6c 6f 63 6b 28 29 3b  rt_time=clock();
07d0: 0d 0a 23 64 65 66 69 6e 65 20 45 4e 44 09 20 76  ..#define END. v
07e0: 65 72 69 66 79 5f 63 61 73 65 28 5f 2c 20 41 6c  erify_case(_, Al
07f0: 74 65 72 6e 61 74 69 6e 67 4c 61 6e 65 28 29 2e  ternatingLane().
0800: 65 78 70 65 63 74 65 64 42 65 61 75 74 79 28 6c  expectedBeauty(l
0810: 6f 77 2c 20 68 69 67 68 29 29 3b 7d 0d 0a 69 6e  ow, high));}..in
0820: 74 20 6d 61 69 6e 28 29 7b 0d 0a 0d 0a 43 41 53  t main(){....CAS
0830: 45 28 30 29 0d 0a 09 69 6e 74 20 6c 6f 77 5f 5b  E(0)...int low_[
0840: 5d 20 3d 20 7b 31 7d 3b 0d 0a 09 20 20 76 65 63  ] = {1};...  vec
0850: 74 6f 72 20 3c 69 6e 74 3e 20 6c 6f 77 28 6c 6f  tor <int> low(lo
0860: 77 5f 2c 20 6c 6f 77 5f 2b 73 69 7a 65 6f 66 28  w_, low_+sizeof(
0870: 6c 6f 77 5f 29 2f 73 69 7a 65 6f 66 28 2a 6c 6f  low_)/sizeof(*lo
0880: 77 5f 29 29 3b 20 0d 0a 09 69 6e 74 20 68 69 67  w_)); ...int hig
0890: 68 5f 5b 5d 20 3d 20 7b 31 30 30 7d 3b 0d 0a 09  h_[] = {100};...
08a0: 20 20 76 65 63 74 6f 72 20 3c 69 6e 74 3e 20 68    vector <int> h
08b0: 69 67 68 28 68 69 67 68 5f 2c 20 68 69 67 68 5f  igh(high_, high_
08c0: 2b 73 69 7a 65 6f 66 28 68 69 67 68 5f 29 2f 73  +sizeof(high_)/s
08d0: 69 7a 65 6f 66 28 2a 68 69 67 68 5f 29 29 3b 20  izeof(*high_)); 
08e0: 0d 0a 09 64 6f 75 62 6c 65 20 5f 20 3d 20 30 2e  ...double _ = 0.
08f0: 30 3b 20 0d 0a 45 4e 44 0d 0a 43 41 53 45 28 31  0; ..END..CASE(1
0900: 29 0d 0a 09 69 6e 74 20 6c 6f 77 5f 5b 5d 20 3d  )...int low_[] =
0910: 20 7b 31 2c 20 31 2c 20 31 7d 3b 0d 0a 09 20 20   {1, 1, 1};...  
0920: 76 65 63 74 6f 72 20 3c 69 6e 74 3e 20 6c 6f 77  vector <int> low
0930: 28 6c 6f 77 5f 2c 20 6c 6f 77 5f 2b 73 69 7a 65  (low_, low_+size
0940: 6f 66 28 6c 6f 77 5f 29 2f 73 69 7a 65 6f 66 28  of(low_)/sizeof(
0950: 2a 6c 6f 77 5f 29 29 3b 20 0d 0a 09 69 6e 74 20  *low_)); ...int 
0960: 68 69 67 68 5f 5b 5d 20 3d 20 7b 32 2c 20 32 2c  high_[] = {2, 2,
0970: 20 32 7d 3b 0d 0a 09 20 20 76 65 63 74 6f 72 20   2};...  vector 
0980: 3c 69 6e 74 3e 20 68 69 67 68 28 68 69 67 68 5f  <int> high(high_
0990: 2c 20 68 69 67 68 5f 2b 73 69 7a 65 6f 66 28 68  , high_+sizeof(h
09a0: 69 67 68 5f 29 2f 73 69 7a 65 6f 66 28 2a 68 69  igh_)/sizeof(*hi
09b0: 67 68 5f 29 29 3b 20 0d 0a 09 64 6f 75 62 6c 65  gh_)); ...double
09c0: 20 5f 20 3d 20 31 2e 30 3b 20 0d 0a 45 4e 44 0d   _ = 1.0; ..END.
09d0: 0a 43 41 53 45 28 32 29 0d 0a 09 69 6e 74 20 6c  .CASE(2)...int l
09e0: 6f 77 5f 5b 5d 20 3d 20 7b 31 2c 20 33 2c 20 35  ow_[] = {1, 3, 5
09f0: 2c 20 37 2c 20 39 7d 3b 0d 0a 09 20 20 76 65 63  , 7, 9};...  vec
0a00: 74 6f 72 20 3c 69 6e 74 3e 20 6c 6f 77 28 6c 6f  tor <int> low(lo
0a10: 77 5f 2c 20 6c 6f 77 5f 2b 73 69 7a 65 6f 66 28  w_, low_+sizeof(
0a20: 6c 6f 77 5f 29 2f 73 69 7a 65 6f 66 28 2a 6c 6f  low_)/sizeof(*lo
0a30: 77 5f 29 29 3b 20 0d 0a 09 69 6e 74 20 68 69 67  w_)); ...int hig
0a40: 68 5f 5b 5d 20 3d 20 7b 32 2c 20 34 2c 20 36 2c  h_[] = {2, 4, 6,
0a50: 20 38 2c 20 31 30 7d 3b 0d 0a 09 20 20 76 65 63   8, 10};...  vec
0a60: 74 6f 72 20 3c 69 6e 74 3e 20 68 69 67 68 28 68  tor <int> high(h
0a70: 69 67 68 5f 2c 20 68 69 67 68 5f 2b 73 69 7a 65  igh_, high_+size
0a80: 6f 66 28 68 69 67 68 5f 29 2f 73 69 7a 65 6f 66  of(high_)/sizeof
0a90: 28 2a 68 69 67 68 5f 29 29 3b 20 0d 0a 09 64 6f  (*high_)); ...do
0aa0: 75 62 6c 65 20 5f 20 3d 20 38 2e 30 3b 20 0d 0a  uble _ = 8.0; ..
0ab0: 45 4e 44 0d 0a 43 41 53 45 28 33 29 0d 0a 09 69  END..CASE(3)...i
0ac0: 6e 74 20 6c 6f 77 5f 5b 5d 20 3d 20 7b 34 2c 20  nt low_[] = {4, 
0ad0: 33 2c 20 33 2c 20 37 7d 3b 0d 0a 09 20 20 76 65  3, 3, 7};...  ve
0ae0: 63 74 6f 72 20 3c 69 6e 74 3e 20 6c 6f 77 28 6c  ctor <int> low(l
0af0: 6f 77 5f 2c 20 6c 6f 77 5f 2b 73 69 7a 65 6f 66  ow_, low_+sizeof
0b00: 28 6c 6f 77 5f 29 2f 73 69 7a 65 6f 66 28 2a 6c  (low_)/sizeof(*l
0b10: 6f 77 5f 29 29 3b 20 0d 0a 09 69 6e 74 20 68 69  ow_)); ...int hi
0b20: 67 68 5f 5b 5d 20 3d 20 7b 31 30 2c 20 37 2c 20  gh_[] = {10, 7, 
0b30: 37 2c 20 37 7d 3b 0d 0a 09 20 20 76 65 63 74 6f  7, 7};...  vecto
0b40: 72 20 3c 69 6e 74 3e 20 68 69 67 68 28 68 69 67  r <int> high(hig
0b50: 68 5f 2c 20 68 69 67 68 5f 2b 73 69 7a 65 6f 66  h_, high_+sizeof
0b60: 28 68 69 67 68 5f 29 2f 73 69 7a 65 6f 66 28 2a  (high_)/sizeof(*
0b70: 68 69 67 68 5f 29 29 3b 20 0d 0a 09 64 6f 75 62  high_)); ...doub
0b80: 6c 65 20 5f 20 3d 20 36 2e 31 37 31 34 32 38 35  le _ = 6.1714285
0b90: 37 31 34 32 38 35 37 32 3b 20 0d 0a 45 4e 44 0d  71428572; ..END.
0ba0: 0a 43 41 53 45 28 34 29 0d 0a 69 6e 74 20 6c 6f  .CASE(4)..int lo
0bb0: 77 5f 5b 5d 20 3d 20 7b 31 2c 31 2c 31 2c 31 2c  w_[] = {1,1,1,1,
0bc0: 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c  1,1,1,1,1,1,1,1,
0bd0: 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c  1,1,1,1,1,1,1,1,
0be0: 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c  1,1,1,1,1,1,1,1,
0bf0: 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c  1,1,1,1,1,1,1,1,
0c00: 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c 31 2c  1,1,1,1,1,1,1,1,
0c10: 31 2c 31 2c 31 2c 31 2c 31 2c 31 7d 3b 0d 0a 09  1,1,1,1,1,1};...
0c20: 20 20 76 65 63 74 6f 72 20 3c 69 6e 74 3e 20 6c    vector <int> l
0c30: 6f 77 28 6c 6f 77 5f 2c 20 6c 6f 77 5f 2b 73 69  ow(low_, low_+si
0c40: 7a 65 6f 66 28 6c 6f 77 5f 29 2f 73 69 7a 65 6f  zeof(low_)/sizeo
0c50: 66 28 2a 6c 6f 77 5f 29 29 3b 20 0d 0a 09 20 20  f(*low_)); ...  
0c60: 69 6e 74 20 68 69 67 68 5f 5b 5d 20 3d 20 7b 31  int high_[] = {1
0c70: 30 30 30 30 30 2c 31 30 30 30 30 30 2c 31 30 30  00000,100000,100
0c80: 30 30 30 2c 31 30 30 30 30 30 2c 31 30 30 30 30  000,100000,10000
0c90: 30 2c 31 30 30 30 30 30 2c 31 30 30 30 30 30 2c  0,100000,100000,
0ca0: 31 30 30 30 30 30 2c 31 30 30 30 30 30 2c 31 30  100000,100000,10
0cb0: 30 30 30 30 2c 31 30 30 30 30 30 2c 31 30 30 30  0000,100000,1000
0cc0: 30 30 2c 31 30 30 30 30 30 2c 31 30 30 30 30 30  00,100000,100000
0cd0: 2c 31 30 30 30 30 30 2c 31 30 30 30 30 30 2c 31  ,100000,100000,1
0ce0: 30 30 30 30 30 2c 31 30 30 30 30 30 2c 31 30 30  00000,100000,100
0cf0: 30 30 30 2c 31 30 30 30 30 30 2c 31 30 30 30 30  000,100000,10000
0d00: 30 2c 31 30 30 30 30 30 2c 31 30 30 30 30 30 2c  0,100000,100000,
0d10: 31 30 30 30 30 30 2c 31 30 30 30 30 30 2c 31 30  100000,100000,10
0d20: 30 30 30 30 2c 31 30 30 30 30 30 2c 31 30 30 30  0000,100000,1000
0d30: 30 30 2c 31 30 30 30 30 30 2c 31 30 30 30 30 30  00,100000,100000
0d40: 2c 31 30 30 30 30 30 2c 31 30 30 30 30 30 2c 31  ,100000,100000,1
0d50: 30 30 30 30 30 2c 31 30 30 30 30 30 2c 31 30 30  00000,100000,100
0d60: 30 30 30 2c 31 30 30 30 30 30 2c 31 30 30 30 30  000,100000,10000
0d70: 30 2c 31 30 30 30 30 30 2c 31 30 30 30 30 30 2c  0,100000,100000,
0d80: 31 30 30 30 30 30 2c 31 30 30 30 30 30 2c 31 30  100000,100000,10
0d90: 30 30 30 30 2c 31 30 30 30 30 30 2c 31 30 30 30  0000,100000,1000
0da0: 30 30 2c 31 30 30 30 30 30 2c 31 30 30 30 30 30  00,100000,100000
0db0: 2c 31 30 30 30 30 30 2c 31 30 30 30 30 30 2c 31  ,100000,100000,1
0dc0: 30 30 30 30 30 2c 31 30 30 30 30 30 7d 3b 0d 0a  00000,100000};..
0dd0: 09 20 20 76 65 63 74 6f 72 20 3c 69 6e 74 3e 20  .  vector <int> 
0de0: 68 69 67 68 28 68 69 67 68 5f 2c 20 68 69 67 68  high(high_, high
0df0: 5f 2b 73 69 7a 65 6f 66 28 68 69 67 68 5f 29 2f  _+sizeof(high_)/
0e00: 73 69 7a 65 6f 66 28 2a 68 69 67 68 5f 29 29 3b  sizeof(*high_));
0e10: 20 0d 0a 09 64 6f 75 62 6c 65 20 5f 20 3d 20 2d   ...double _ = -
0e20: 31 3b 20 0d 0a 45 4e 44 0d 0a 2f 2a 0d 0a 43 41  1; ..END../*..CA
0e30: 53 45 28 35 29 0d 0a 09 69 6e 74 20 6c 6f 77 5f  SE(5)...int low_
0e40: 5b 5d 20 3d 20 3b 0d 0a 09 20 20 76 65 63 74 6f  [] = ;...  vecto
0e50: 72 20 3c 69 6e 74 3e 20 6c 6f 77 28 6c 6f 77 5f  r <int> low(low_
0e60: 2c 20 6c 6f 77 5f 2b 73 69 7a 65 6f 66 28 6c 6f  , low_+sizeof(lo
0e70: 77 5f 29 2f 73 69 7a 65 6f 66 28 2a 6c 6f 77 5f  w_)/sizeof(*low_
0e80: 29 29 3b 20 0d 0a 09 69 6e 74 20 68 69 67 68 5f  )); ...int high_
0e90: 5b 5d 20 3d 20 3b 0d 0a 09 20 20 76 65 63 74 6f  [] = ;...  vecto
0ea0: 72 20 3c 69 6e 74 3e 20 68 69 67 68 28 68 69 67  r <int> high(hig
0eb0: 68 5f 2c 20 68 69 67 68 5f 2b 73 69 7a 65 6f 66  h_, high_+sizeof
0ec0: 28 68 69 67 68 5f 29 2f 73 69 7a 65 6f 66 28 2a  (high_)/sizeof(*
0ed0: 68 69 67 68 5f 29 29 3b 20 0d 0a 09 64 6f 75 62  high_)); ...doub
0ee0: 6c 65 20 5f 20 3d 20 3b 20 0d 0a 45 4e 44 0d 0a  le _ = ; ..END..
0ef0: 2a 2f 0d 0a 7d 0d 0a 2f 2f 20 45 4e 44 20 43 55  */..}..// END CU
0f00: 54 20 48 45 52 45 0d 0a                          T HERE..