Hi.
I started 3 days ago doing tasks in Polish Spoj. And today i got such a annoying problem. I cant complete some tasks with Java becouse of compiling time. For example, there is a task when you have to calculate avarage speed. Imo this is the simplest way but its still too long:
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
while(n-->0){
int v1 = scanner.nextInt();
int v2 = scanner.nextInt();
System.out.println((2*v1*v2)/(v1+v2));
}
When this in c++ passed with colours:
int v1,v2;
cin>>howMuch;
for (int i=1; i<=howMuch; i++)
{
cin>>v1>>v2;
cout<<2*v1*v2/(v1+v2)<<endl;
}
This is polish version: http://pl.spoj.com/problems/VSR/