You are viewing a single comment's thread. Return to all comments →
Getting runtime error for testcases 4,5,6. suceesfully executed 1,2,3.How to find out the reason for run time error. Help
public class Solution {
public static void main(String[] args) { Scanner g=new Scanner(System.in); int side=g.nextInt(); int v1=g.nextInt(); int v2=g.nextInt(); double a = Math.sqrt(2); double diagonal=a * side; int v3=Math.abs(v1-v2); int t=g.nextInt(); for(int i=0;i<t;i++) { int distance=g.nextInt(); double diagonal2=a * Math.sqrt(distance); if(v3 != 0) { double result = (Math.abs(diagonal-diagonal2))/v3; System.out.println(result); } else { System.out.println(0.00000000000000); } } }
}
Sherlock and Moving Tiles
You are viewing a single comment's thread. Return to all comments →
Getting runtime error for testcases 4,5,6. suceesfully executed 1,2,3.How to find out the reason for run time error. Help
public class Solution {
}