Number of buildings N is at most 1121.Mukit Chowdhury wrote: ↑Wed Mar 13, 2013 5:50 pmIn this problem array of 1500 elements is enough... no need to check negative number ... My algo is of O(n*n) and Accepted in 0.068 second...

## Search found 585 matches

- Sat Jul 22, 2017 8:43 pm
- Forum: Volume 117 (11700-11799)
- Topic: 11790 - Murcia's Skyline
- Replies:
**28** - Views:
**12838**

### Re: 11790 - Murcia's Skyline(TLE)

- Thu Jul 20, 2017 6:36 pm
- Forum: Volume 122 (12200-12299)
- Topic: 12210 - A Match Making Problem
- Replies:
**1** - Views:
**905**

### Re: 12210 - A Match Making Problem

Input data of fourth case is not correct. Age of bachelor and spinster should be between 2..60. Each of the next B lines contains one integer between 2 and 60 (inclusive) which denotes the age of one bachelor in the community. Each of the next S lines contains one integer between 2 and 60 (inclusive...

- Mon Jul 17, 2017 2:06 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10685 - Nature
- Replies:
**41** - Views:
**16535**

### Re: 10685 - Nature

Second input (exactly 6, 7, 8, 9, 12, 13, 15, 17 test cases) on uDebug named by "Online Uva judge" is not correct. Because creature's names are listed in one line. But according to problem's description they should be on C lines, where C is number of creatures. Follow C lines with the names of the c...

- Sat Jul 15, 2017 2:43 pm
- Forum: Volume 3 (300-399)
- Topic: 394 - Mapmaker
- Replies:
**22** - Views:
**5123**

### Re: 394 - Mapmaker

Number of arrays is not more than 5.

- Sat Jul 15, 2017 1:40 pm
- Forum: Volume 6 (600-699)
- Topic: 628 - Passwords
- Replies:
**14** - Views:
**7976**

### Re: 628 - Passwords

Although this is not clearly mentioned in the problem statement, the following is probably true: If there exists one word in the dictionary there can exist several #'s in the input; otherwise, if there exist several words in the dictionary, there exists no more than one # in the judge's input. Why ...

- Fri Jun 30, 2017 5:55 am
- Forum: Volume 126 (12600-12699)
- Topic: 12675 - Hide and seek
- Replies:
**1** - Views:
**707**

### Re: 12675 - Hide and seek

Got wa. Need some critical input.
Why for input above udebug(UVa Online Judge's solution) gives output
Two seeking kids see each other. So output should 1 for each kid. Is this bug?

Code: Select all

```
2 2 1
13 11
17 15
1 5 8 13
```

Code: Select all

```
0
0
```

Code: Select all

```
1
1
```

- Wed Jun 28, 2017 4:23 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10447 - Sum-up the Primes (II)
- Replies:
**10** - Views:
**4877**

### Re: 10447 - Sum-up the Primes (II)

Solved with dp. My previous dp approaches gave me TLE.

Memory : 244*800*12, where 244 = 61 * 4 (4 is maximum frequency).

Time___: 244*800*12, for each block of input.

Memory : 244*800*12, where 244 = 61 * 4 (4 is maximum frequency).

Time___: 244*800*12, for each block of input.

- Wed Jun 28, 2017 4:05 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10332 - The Absent Minded Professor
- Replies:
**22** - Views:
**3905**

### Re: 10332 - The Absent Minded Professor

For input
My acc prog gives

Code: Select all

```
6
1 2 2 3 4 5 6 7 7 8 9 10 11 13 14
```

Code: Select all

`0 4 6 11 13 14`

- Tue Jun 27, 2017 6:00 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10419 - Sum-up the Primes
- Replies:
**51** - Views:
**14673**

### Re: He He

When I made Sumup the primes I intended people to use backtracking with constraints to solve this problem but they got away with more conventional dynamic programming approach so I have made sum up the primes (II) so they have to use backtracking with constraints to solve this problem :wink:, so th...

- Tue Jun 27, 2017 5:54 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10571 - Products
- Replies:
**27** - Views:
**8211**

### Re: 10571 - Products

Solved 10447 with DP in 0.820.

- Fri Apr 28, 2017 11:47 am
- Forum: Volume 108 (10800-10899)
- Topic: 10819 - Trouble of 13-Dots
- Replies:
**67** - Views:
**30562**

### Re: 10819 - Trouble of 13-Dots

Now for Jujuedv's test case uDebug gives correct answer 6. Some information that may be relevant for anyone working on this problem: my code passed even though it returned different results for the test input of Morass in uDebug. Concretely the following lines differed: Line 494 -> uDebug 53, Mine 5...

- Thu Mar 16, 2017 10:46 am
- Forum: Volume 8 (800-899)
- Topic: 884 - Factorial Factors
- Replies:
**49** - Views:
**24245**

### Re: 884 - Factorial Factors

My code accepted in 0.020. My sieve is similar to yours, but it's not bitwise. You can optimize second step. I precalculated all the results without factorization. I calculate it in O(1000000) with only one loop. I used array cnt[1000001], instead of variable cnt. For each N from 2 to 1000000 store ...

- Thu Mar 16, 2017 9:34 am
- Forum: Volume 101 (10100-10199)
- Topic: 10102 getting Wrong Answer , please help me to solve it
- Replies:
**4** - Views:
**380**

### Re: 10102 getting Wrong Answer , please help me to solve it

If you assume that square field can have size 1000x1000 , then you should also assume that number of cells with color 1 or color 3 can be at most 999999 . But your arrays xo, yo, xt, yt have size only 1000 . You should get RE in this case, but not always. Sometimes you get WA. I checked that size of...

- Wed Mar 15, 2017 3:57 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10102 getting Wrong Answer , please help me to solve it
- Replies:
**4** - Views:
**380**

### Re: 10102 getting Wrong Answer , please help me to solve it

You initialized variable
Also you should print a newline after the answer.

**e**by value 1, so your code always prints blank line before printing the answer.Code: Select all

```
int xo[1000], yo[1000], xt[1000], yt[1000], maxi, N,e=1;
..
if (e)cout << endl;
cout << maxi;
e = 1;
```

- Wed Mar 15, 2017 3:36 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10622 - Perfect P-th Powers
- Replies:
**47** - Views:
**21755**

### Re: 10622 - Perfect P-th Powers

Your code fails some test cases on Morass's last input. https://www.udebug.com/UVa/10622