Search found 5 matches

by gsingh93
Tue Jul 17, 2012 2:22 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 109638

Re: 101 WA Java

I have this code:

Code: Select all

if (i != lists.length - 1)
            System.out.println("");
Which should print a newline.
by gsingh93
Mon Jul 09, 2012 1:16 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 109638

101 WA Java

I'm getting a WA on problem 101. I'll paste my code and some sample inputs and outputs.
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

class Main {

private static Map<Integer, Integer> posMap = new HashMap<Integer ...
by gsingh93
Thu May 17, 2012 7:15 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318634

Re: WA for problem 100

I forgot the return 0 :/

Compiler didn't even give me a warning...
by gsingh93
Thu May 17, 2012 6:28 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318634

WA for problem 100

I've searched the forums, but can't find anything wrong with this code:
#include <iostream>

using namespace std;

int countCycles(int, int);

int main() {
int i, j, cycles;

while (cin >> i >> j) {
if (i > j)
cycles = countCycles(i, j);
else
cycles = countCycles(j, i);

cout << i ...
by gsingh93
Sat Jan 07, 2012 8:35 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 318634

WA on Problem 100

I'm getting a wrong answer on Problem 100. Before you ask, yes, I did consider that j < i. I've tested it and it works fine. It works with all of the given samples. Here is my code.
#include <iostream>

using namespace std;

int main ()
{
int i, j, maxLength = 0, temp, count, swap;

while(cin ...

Go to advanced search