Re: [gcj] Any Optimal Solution for "Round 1A: Minimum Scalar Product" Problem?

2016-04-13 Thread wonjun
The main idea is the rearrangement inequality; check out the contest analysis ^^. On 14 Apr 2016 14:13, "akhil patel" wrote: > Hi, > > As i have been doing this problem in python using my own method which > computes for the all possible permutations and finding the scalar

[gcj] Easy way to do Java I/O?

2014-03-31 Thread wonjun
Hey guys, I normally submit my programs in Python, but for this time I'd like to do a mix of both Python and Java. I wonder if this is a good way to do it: import java.io.*; public class Pogo { public String solve(int x, int y) { . // returns the answer... } public static void

Re: [gcj] How to take input in topcoder problem

2013-07-20 Thread wonjun
I normally go to the view section and copy everything. For instance if it was the problem of SRM 584 Div 1 Egalitarianism, I would copy the following: {NYN, YNY, NYN}, 10 20 Passed {NN, NN}, 1 -1 Passed etc and put it in a file, say EgalitarianismTest.txt Then I read the file, like the

Re: [gcj] Re: Can anyone pls provide me idea or partial solution on this problem in c++ without using STL?

2013-05-12 Thread wonjun
That doesn't matter. They're both excellent courses and their objectives are very much different. On May 12, 2013 10:22 PM, Vaibhav Tulsyan wittynwise2...@gmail.com wrote: Is Tim Roughgarden's course better than Sedgewick's? On Sun, May 12, 2013 at 10:13 PM, Stanislav Zholnin

Re: [gcj] Python IO help

2013-04-15 Thread wonjun
mySolution.py A-small-attempt85.in a.out This will treat that in file as standard in and output to the out file. Sent from my iPad On 15 Apr 2013, at 06:27, wonjun wonj...@gmail.com wrote: Hello All, I mainly code in Python, and is quite confused with the IO part. Well I normally do

[gcj] Python IO help

2013-04-14 Thread wonjun
Hello All, I mainly code in Python, and is quite confused with the IO part. Well I normally do the following for IO: f = open('filename','r') a = f.read() b = a.split('\n') Now, depending on the problem at hand, I use a for loop / while loop to look over all cases and solve them accordingly. I

Re: [gcj] round 2 2009, problem A.

2012-04-09 Thread wonjun
As far as I understand, it says 1 values should be below or on the diagonal, (*) so we can do the following: 1) 1110 1100 1100 1000 2) 1110 1100 1000 1100 (ie R3 - R4) 3) 1100 1110 1000 1100 (R1 - R2) 4) 1100 1000 1110 1100 (R2 - R3) 5) 1000 1100 1110 1100 (R1 - R2) Note that the final