Search found 58 matches

by Phantom
8 years ago
Forum: Problem set
Topic: 1201 - Select Your Ropes
Replies: 3
Views: 671
Gender: None specified

Re: 1201 - Select Your Ropes

I solve this problem… and I think the answer is not the solution to the question…
by Phantom
8 years ago
Forum: Problem set
Topic: 1767 - Funny Areas
Replies: 1
Views: 385
Gender: None specified

Re: 1767 - Funny Areas

I got only WA in this problem, and I proved it even with negatives values in the center. I cannot understand…. Who is wrong, the COJ or me?? Can anybody help me? This is my code in C++(is not AC): #include <cstdlib> #include <iostream> using namespace std; int max(int, int); int min(int, int); int m...
by Phantom
8 years ago
Forum: Other languages
Topic: C#
Replies: 20
Views: 19858
Gender: None specified

Re: C#

Ok, C#, good idea, I like this language too, no many as Python and Ruby, but I like it. I can say this is the language in where I am better. If you know something about C, C++ or Java, C# will be very easy for you. C# is upswing of the languages before mentioned. If you want I teach you C#, I’ll do ...
by Phantom
8 years ago
Forum: Other languages
Topic: Python
Replies: 36
Views: 33524
Gender: None specified

Re: Python

Yes, thank you Robbin for help me to complement my arguments. That is one of the things I love of Python, your program in Python is naturally beautiful because the language force you to program beautiful. That make me remind the Zen of Python. One of the things the Zen of Python say is (beside is th...
by Phantom
8 years ago
Forum: Other languages
Topic: Ruby
Replies: 23
Views: 21085
Gender: None specified

Re: Ruby

Ah!!! I know what program you are talking about… Its icon is a demitasse. This program is in Linux too. My friends said that it is e good text editor. In Windows, the text editor that I use is the Notepad++. If I can program in C# with geany, it sound perfect.
by Phantom
8 years ago
Forum: Problem set
Topic: 1009 - Arranging Amplifiers
Replies: 15
Views: 6030
Gender: None specified

Re: 1009 - Arranging Amplifiers

I am agreeing with adrianc, because personally, I know program C++, but I dislike it very much. I generally program in Python, C# and Ruby; and for me, get TLE whit good algorithms, now is something normal. I think these problems mustn’t exist. And… specially in this problem, I got a TLE too. We are...
by Phantom
8 years ago
Forum: Problem set
Topic: 1859 - Parts Acquisition
Replies: 4
Views: 714
Gender: None specified

Re: 1859 - Parts Acquisition

Thank you very very much!!
by Phantom
8 years ago
Forum: Other languages
Topic: Ruby
Replies: 23
Views: 21085
Gender: None specified

Re: Ruby

What is that?? An IDE??
by Phantom
8 years ago
Forum: Algorithms
Topic: DFS
Replies: 2
Views: 3050
Gender: None specified

Re: DFS

Here an example of DFS in Ruby: def DFS(graph, pos) marks = [false] * graph.size marks[pos] = true __DFS(graph, pos, marks){ |i| yield i } end def __DFS(graph, pos, marks) for i in graph[pos]: if !marks[i] marks[i] = true yield i __DFS(graph, i, marks){ |j| yield j } end end end #Example: graph = [[...
by Phantom
8 years ago
Forum: Algorithms
Topic: BFS
Replies: 2
Views: 3114
Gender: None specified

Re: BFS

Here an example of BFS in Ruby(my implementation): def BFS(graph, pos) marks, queue = [false] * graph.length, [pos] marks[pos] = true while !queue.empty? act = queue.delete_at(0) for i in graph[act]: if !marks[i]: marks[i] = true queue.push(i) yield i end end end end #Example: graph = [[3], [0, 2, 5...

Go to advanced search