Search found 139 matches
- Thu Mar 16, 2017 10:13 am
- Forum: Volume 9 (900-999)
- Topic: 905 - Tacos Panchita
- Replies: 1
- Views: 1014
Re: 905 - Tacos Panchita
The sample output was still wrong.
- Mon Mar 13, 2017 10:24 am
- Forum: Volume 9 (900-999)
- Topic: 918 - ASCII Mandelbrot
- Replies: 11
- Views: 4089
Re: 918 - ASCII Mandelbrot
The description of problem is not so clear.
Z = Z * Z + C means:
Given a complex number C = 1 + i
iteration 1: Z = 0 + C = 1 + i, d = sqrt(1 + 1) = sqrt(2);
iteration 2: Z = (1 + i) * (1 + i) + (1 + i) = 1 + 3i, d = sqrt(1 + 9) = sqrt(10);
...
Z = Z * Z + C means:
Given a complex number C = 1 + i
iteration 1: Z = 0 + C = 1 + i, d = sqrt(1 + 1) = sqrt(2);
iteration 2: Z = (1 + i) * (1 + i) + (1 + i) = 1 + 3i, d = sqrt(1 + 9) = sqrt(10);
...
- Fri Feb 24, 2017 10:56 am
- Forum: Volume 4 (400-499)
- Topic: 456 - Robotic Stacker
- Replies: 2
- Views: 1275
Re: 456 - Robotic Stacker
It can be solved using greedy algorithm, why?
- Fri Feb 24, 2017 10:56 am
- Forum: Volume 4 (400-499)
- Topic: 456 - Robotic Stacker
- Replies: 2
- Views: 1275
Re: 456 - Robotic Stacker
The solution on uDebug gives different answer which I thought wrong.
- Wed Feb 22, 2017 5:20 am
- Forum: Volume 5 (500-599)
- Topic: 554 - Caesar Cypher
- Replies: 27
- Views: 11301
Re: 554 - Caesar Cypher
There are so many ads, please administrator clear it all!
- Tue Feb 21, 2017 3:42 pm
- Forum: Volume 5 (500-599)
- Topic: 554 - Caesar Cypher
- Replies: 27
- Views: 11301
Re: 554 - Caesar Cypher
The output specification is not so clear.
You should print a '\n' at end of EVERY line of output even the last line.
I didn't print a '\n' at last line that brings to me many WAs.
You should print a '\n' at end of EVERY line of output even the last line.
I didn't print a '\n' at last line that brings to me many WAs.
- Tue Aug 30, 2016 11:18 am
- Forum: Volume 6 (600-699)
- Topic: 635 - Clock solitaire
- Replies: 8
- Views: 4001
Re: 635 - Clock solitaire
The test data generator. #include <iostream> #include <algorithm> #include <ctime> #include <random> using namespace std; int main(int argc, char *argv[]) { string cards = "7J93JQKA23456789T8QKA23456789TJQKA23456789TJQKA2T456"; for (int i = 1; i <= 100; i++) { shuffle (cards.begin(), cards...
- Tue Aug 30, 2016 11:04 am
- Forum: Volume 6 (600-699)
- Topic: 635 - Clock solitaire
- Replies: 8
- Views: 4001
Re: 635 - Clock solitaire
The statement of problem is not so clear, I spent some time on Internet to figure out the rule of Clock game. The rule in this problem differs from regular rule. you should beware of two points below: 1. When you deal the cards, you should place four card at one clock, then four cards at two clock, ...
- Mon Aug 29, 2016 9:53 am
- Forum: Volume 6 (600-699)
- Topic: 641 - Do the Untwist
- Replies: 9
- Views: 5964
Re: 641 - Do the Untwist
Test data generator. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int gcd(int a, int b) { int t; while (a % b) t = a, a = b, b = t % b; return b; } int plaincode[80], ciphercode[80]; int main(int argc, char *argv[]) { string letters = "_abcdefghijklmnopqrstuvwxyz...
- Thu Aug 18, 2016 5:24 pm
- Forum: Volume 5 (500-599)
- Topic: 586 - Instant Complexity
- Replies: 6
- Views: 4197
Re: 586 - Instant Complexity
There is test data generator wrote in C++ below. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; const int MAX_CASES = 100, MAX_OP = 60, MAX_STACK = 10, BASE = 10; int main(int argc, char *argv[]) { cout << MAX_CASES << "\n\n"; srand(time(NULL)); for (int c = 1...
- Thu Aug 18, 2016 8:40 am
- Forum: Volume 5 (500-599)
- Topic: 545 - Heads
- Replies: 67
- Views: 45370
Re: 545 - Heads
The format of Sample Input is wrong, there is no r in first line.
- Thu Aug 18, 2016 3:12 am
- Forum: Volume 5 (500-599)
- Topic: 551 - Nesting a Bunch of Brackets
- Replies: 56
- Views: 13380
Re: 551 - Nesting a Bunch of Brackets
Poor problem statement.
"but if you reach the end of a test case and not find an expression not properly nested and some brackets are even opened you must print number_of_chars_of_the_case + 1"
"but if you reach the end of a test case and not find an expression not properly nested and some brackets are even opened you must print number_of_chars_of_the_case + 1"
- Sun Aug 07, 2016 5:48 am
- Forum: Volume 5 (500-599)
- Topic: 573 - The Snail
- Replies: 45
- Views: 20632
Re: 573 - The Snail
I misunderstood the problem, the statement: "The snail has a fatigue factor of 10%, which means that on each successive day the snail climbs 10% 3 = 0.3 feet less than it did the previous day." means every day, the snail lost 10% of climbed distances, no matter climbed distances bellow zer...
- Thu Aug 04, 2016 10:27 am
- Forum: Volume 4 (400-499)
- Topic: 428 - Swamp County Roofs
- Replies: 7
- Views: 2663
Re: 428 - Swamp County Roofs
The input format is not so friendly.
- Mon Aug 01, 2016 4:41 am
- Forum: Volume 4 (400-499)
- Topic: 427 - FlatLand Piano Movers
- Replies: 2
- Views: 2859
Re: 427 - FlatLand Piano Movers
Use ternary search. The code below is test data generator. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char *argv[]) { srand(time(NULL)); for (int c = 1; c <= 100; c++) { int l = rand() % 1000; int w = rand() % 1000; if (l < w) swap(l, w); if (l ==...