Search found 31 matches
- Sun Oct 07, 2007 1:34 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11309 - Counting Chaos
- Replies: 18
- Views: 7357
When determining if HH:MM is palindromic, ignore all leading zeroes in HH. If HH is zero then ignore all leading zeroes in MM. according to the statement for determining if 01:21 is palindromic, we must ignore all leading zeroes in 01 so we have 1:21. it's obvious that 121 is palindromic. The same ...
- Sat Oct 06, 2007 10:58 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11310 - Delivery Debacle
- Replies: 19
- Views: 10438
- Sat Oct 06, 2007 10:03 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11310 - Delivery Debacle
- Replies: 19
- Views: 10438
11310 - Delivery Debacle
This problem was the easiest one and many people solve it in the contest time But I don't know why I can't solve it! I use dp: suppose f(i) is the number of 2-by-i box (width = 2 and length = i) so we have: f(i) = 4 * f(i - 2) + f(i - 1) f(i) = 1 if i = 0 f(i) =0 if i < 0 There are four possibilitie...
- Sat Oct 06, 2007 5:37 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11309 - Counting Chaos
- Replies: 18
- Views: 7357
Try this:
input:
output:
input:
Code: Select all
5
23:59
01:20
01:09
00:08
00:22
Code: Select all
00:00
01:21
01:11
00:09
00:33
- Mon Aug 13, 2007 3:44 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10180 - Rope Crisis in Ropeland!
- Replies: 39
- Views: 22546
- Sat Aug 04, 2007 10:43 am
- Forum: Volume 112 (11200-11299)
- Topic: 11246 - K-Multiple Free set
- Replies: 16
- Views: 6228
I thought the IEEE standard for double precision floating point numbers requires them to represent 52bit fractional digits. So it follows that they can represent every 32bit integers exactly. However, some decimal such as 0.1 don't have a finite base 2 representation, so they can't be represented e...
- Fri Aug 03, 2007 10:29 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11246 - K-Multiple Free set
- Replies: 16
- Views: 6228
1) Don't use float, double, long double (same as double in some compilers) as sentinel. for example: double i; for (i = 0; i < 3; i++) //dangerous code { } you declare t as long double. In my compiler your program didn't terminate so you must declare t as int. 2) I think you don't understand the rec...
- Thu Aug 02, 2007 9:02 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11246 - K-Multiple Free set
- Replies: 16
- Views: 6228
- Wed Aug 01, 2007 10:43 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11246 - K-Multiple Free set
- Replies: 16
- Views: 6228
- Sun Jul 29, 2007 6:11 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11246 - K-Multiple Free set
- Replies: 16
- Views: 6228
- Sun Jul 29, 2007 3:11 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11246 - K-Multiple Free set
- Replies: 16
- Views: 6228
Thanks for your reply sclo. Can you give me some hint? I saw Double-Free Set recurrence that works for k = 2:
But how above recurrence work?
Code: Select all
f(n) = ceil(n / 2) + f(floor(n / 4))
- Sun Jul 29, 2007 7:03 am
- Forum: Volume 112 (11200-11299)
- Topic: 11246 - K-Multiple Free set
- Replies: 16
- Views: 6228
11246 - K-Multiple Free set
Hi I got AC this question in the contest time but when this question added in online judge problemset I got TLE. What's Wrong? My algorithm is: I first select the numbers that is not the factor of k then consider the factors of k. suppose x is a factor of k (x = ak) if I selected a or a is belong to...
- Thu Jun 21, 2007 1:43 pm
- Forum: C++
- Topic: Why we can use "while(cin >> a)"
- Replies: 6
- Views: 3293
Krzysztof Duleba right there is a converstion operator. for example: #include <iostream> using namespace std; struct test { int a; }; int main() { test a; while (a) // Syntax error { } return 0; } but if you define a conversion operator the code will be correct: #include <iostream> using namespace s...
- Thu Jun 21, 2007 1:28 pm
- Forum: C++
- Topic: 2D string array for STL sort
- Replies: 3
- Views: 2898
I think you cannot use two dimensional array in sort function: int a[3][2] = {{1, 2}, {3, 4}, {5, 6}}; sort(a, a + 3); // Syntax eror for solving this problem you must use vector: #include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; void print(vector<stri...
- Thu Jun 21, 2007 11:17 am
- Forum: C++
- Topic: EBook for C++
- Replies: 1
- Views: 1743
You can download "Thinking in C++" by Bruce Eckel from:
http://www.mindview.net/Books/DownloadSites/
http://www.mindview.net/Books/DownloadSites/