Search found 4 matches

by CGR
Tue Sep 19, 2006 8:05 pm
Forum: Volume 101 (10100-10199)
Topic: 10142 - Australian Voting
Replies: 82
Views: 31650

:-?

So.. when input is

Code: Select all

4
jalal
hasan
bijon
saiket
1 2 3 4
3 1 2 4
1 2      3 4
2 1  3 4
3 1 2 4
4 3        1 3 
output is

Code: Select all

jalal
bijon
???

Shouldn't we ignore the last ballot, since it's not valid ?
But if we do so, output would be jalal, without bijon..
by CGR
Mon Sep 18, 2006 8:55 pm
Forum: Volume 100 (10000-10099)
Topic: 10041 - Vito's Family
Replies: 90
Views: 30870

Why WA????? :cry: I'm using the median, I tried every input/output found in this forum, and it works for all of them. This pb seems so easy.. My code : #include <stdio.h> int compare (int*, int*); main() { int n_cases, n_relat; int median, min; int sum_dist; int i,j; int streets[510]; scanf("%d", &n...
by CGR
Wed Oct 12, 2005 7:30 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 193889

import java.util.*; import java.io.*; class Main { public static void main(String[] args) { StringTokenizer st; String s; int i,j; while ((s = readLn(100).trim()) != null) { st= new StringTokenizer(s); i= Integer.parseInt(st.nextToken()); j= Integer.parseInt(st.nextToken()); System.out.println(i+" "...
by CGR
Sun Oct 09, 2005 8:22 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 193889

100 java - WA...

This pb is driven me crazy.. WA, and I don't know why. I read all the topics but didn't find anything.. For this input : 1 1 1 2 2 1 3 3 3627 5749 I obtain : 1 1 1 1 2 2 2 1 2 3 3 8 3627 5749 238 This is my code : import java.util.*; import java.io.*; class Main { public static void main(String[] ar...

Go to advanced search