| Task: | Rain Fall |
| Sender: | PILIPOJAT!! |
| Submission time: | 2016-10-04 17:37:36 +0300 |
| Language: | Java |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | RUNTIME ERROR | 0.15 s | details |
| #2 | RUNTIME ERROR | 0.13 s | details |
| #3 | RUNTIME ERROR | 0.16 s | details |
| #4 | RUNTIME ERROR | 0.12 s | details |
| #5 | RUNTIME ERROR | 0.18 s | details |
| #6 | RUNTIME ERROR | 0.16 s | details |
| #7 | RUNTIME ERROR | 0.13 s | details |
| #8 | RUNTIME ERROR | 0.15 s | details |
| #9 | RUNTIME ERROR | 0.12 s | details |
| #10 | RUNTIME ERROR | 0.12 s | details |
| #11 | RUNTIME ERROR | 0.14 s | details |
| #12 | RUNTIME ERROR | 0.14 s | details |
| #13 | RUNTIME ERROR | 0.14 s | details |
| #14 | RUNTIME ERROR | 0.14 s | details |
| #15 | RUNTIME ERROR | 0.10 s | details |
| #16 | RUNTIME ERROR | 0.12 s | details |
| #17 | RUNTIME ERROR | 0.20 s | details |
| #18 | RUNTIME ERROR | 0.10 s | details |
| #19 | RUNTIME ERROR | 0.11 s | details |
| #20 | RUNTIME ERROR | 0.11 s | details |
| #21 | RUNTIME ERROR | 0.13 s | details |
| #22 | RUNTIME ERROR | 0.12 s | details |
| #23 | RUNTIME ERROR | 0.11 s | details |
| #24 | RUNTIME ERROR | 0.11 s | details |
| #25 | RUNTIME ERROR | 0.11 s | details |
| #26 | RUNTIME ERROR | 0.12 s | details |
| #27 | RUNTIME ERROR | 0.12 s | details |
| #28 | RUNTIME ERROR | 0.15 s | details |
| #29 | RUNTIME ERROR | 0.12 s | details |
| #30 | RUNTIME ERROR | 0.14 s | details |
| #31 | RUNTIME ERROR | 0.13 s | details |
| #32 | RUNTIME ERROR | 0.13 s | details |
| #33 | RUNTIME ERROR | 0.12 s | details |
| #34 | RUNTIME ERROR | 0.10 s | details |
| #35 | RUNTIME ERROR | 0.12 s | details |
| #36 | RUNTIME ERROR | 0.12 s | details |
Code
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cses;
import java.util.*;
import java.io.*;
/**
*
* @author eamiller
*/
public class Cses {
public static void main(String[] args) {
IO io = new IO();
double l = io.nextDouble();
double k = io.nextDouble();
double t1 = io.nextDouble();
double t2 = io.nextDouble();
double h = io.nextDouble();
double a = (-1)*(k / t1);
double b = (h/t1 + k + (t2/t1)*k);
double c = (-1)*l;
double tx1 = ((-1)*b + Math.sqrt(Math.pow(b, 2) - 4*a*c))
/ (2*a);
// double tx2 = ((-1)*b - Math.sqrt(Math.pow(b, 2) - 4*a*c))
// / (2*a);
double s1 = l/tx1;//SADETAHTI
// double s2 = l/tx2;
double f2 = s1 * t1;
double f1 = h + t2*k;
if(h < l){
f2 = h;
f1 = h;
}else if(h == l){
f1 = h;
}
System.out.println(f1 + " " + f2);
}
public static class IO extends PrintWriter {
private InputStreamReader r;
private static final int BUFSIZE = 1 << 15;
private char[] buf;
private int bufc;
private int bufi;
private StringBuilder sb;
public IO() {
super(new BufferedOutputStream(System.out));
r = new InputStreamReader(System.in);
buf = new char[BUFSIZE];
bufc = 0;
bufi = 0;
sb = new StringBuilder();
}
private void fillBuf() throws IOException {
bufi = 0;
bufc = 0;
while(bufc == 0) {
bufc = r.read(buf, 0, BUFSIZE);
if(bufc == -1) {
bufc = 0;
return;
}
}
}
private boolean pumpBuf() throws IOException {
if(bufi == bufc) {
fillBuf();
}
return bufc != 0;
}
private boolean isDelimiter(char c) {
return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f';
}
private void eatDelimiters() throws IOException {
while(true) {
if(bufi == bufc) {
fillBuf();
if(bufc == 0) throw new RuntimeException("IO: Out of input.");
}
if(!isDelimiter(buf[bufi])) break;
++bufi;
}
}
public String next() {
try {
sb.setLength(0);
eatDelimiters();
int start = bufi;
while(true) {
if(bufi == bufc) {
sb.append(buf, start, bufi - start);
fillBuf();
start = 0;
if(bufc == 0) break;
}
if(isDelimiter(buf[bufi])) break;
++bufi;
}
sb.append(buf, start, bufi - start);
return sb.toString();
} catch(IOException e) {
throw new RuntimeException("IO.next: Caught IOException.");
}
}
public int nextInt() {
try {
int ret = 0;
eatDelimiters();
boolean positive = true;
if(buf[bufi] == '-') {
++bufi;
if(!pumpBuf()) throw new RuntimeException("IO.nextInt: Invalid int.");
positive = false;
}
boolean first = true;
while(true) {
if(!pumpBuf()) break;
if(isDelimiter(buf[bufi])) {
if(first) throw new RuntimeException("IO.nextInt: Invalid int.");
break;
}
first = false;
if(buf[bufi] >= '0' && buf[bufi] <= '9') {
if(ret < -214748364) throw new RuntimeException("IO.nextInt: Invalid int.");
ret *= 10;
ret -= (int)(buf[bufi] - '0');
if(ret > 0) throw new RuntimeException("IO.nextInt: Invalid int.");
} else {
throw new RuntimeException("IO.nextInt: Invalid int.");
}
++bufi;
}
if(positive) {
if(ret == -2147483648) throw new RuntimeException("IO.nextInt: Invalid int.");
ret = -ret;
}
return ret;
} catch(IOException e) {
throw new RuntimeException("IO.nextInt: Caught IOException.");
}
}
public long nextLong() {
try {
long ret = 0;
eatDelimiters();
boolean positive = true;
if(buf[bufi] == '-') {
++bufi;
if(!pumpBuf()) throw new RuntimeException("IO.nextLong: Invalid long.");
positive = false;
}
boolean first = true;
while(true) {
if(!pumpBuf()) break;
if(isDelimiter(buf[bufi])) {
if(first) throw new RuntimeException("IO.nextLong: Invalid long.");
break;
}
first = false;
if(buf[bufi] >= '0' && buf[bufi] <= '9') {
if(ret < -922337203685477580L) throw new RuntimeException("IO.nextLong: Invalid long.");
ret *= 10;
ret -= (long)(buf[bufi] - '0');
if(ret > 0) throw new RuntimeException("IO.nextLong: Invalid long.");
} else {
throw new RuntimeException("IO.nextLong: Invalid long.");
}
++bufi;
}
if(positive) {
if(ret == -9223372036854775808L) throw new RuntimeException("IO.nextLong: Invalid long.");
ret = -ret;
}
return ret;
} catch(IOException e) {
throw new RuntimeException("IO.nextLong: Caught IOException.");
}
}
public double nextDouble() {
return Double.parseDouble(next());
}
}
}
Test details
Test 1
Verdict: RUNTIME ERROR
| input |
|---|
| 80.00 0.50 2.00 1.50 80.00 |
| correct output |
|---|
| 80.000000000 80.759403280 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 2
Verdict: RUNTIME ERROR
| input |
|---|
| 100.00 0.50 2.00 1.50 80.00 |
| correct output |
|---|
| 80.000000000 80.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| 150.00 1.00 100.00 150.00 100.... |
| correct output |
|---|
| 100.000000000 100.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 4
Verdict: RUNTIME ERROR
| input |
|---|
| 150.00 1.00 100.00 150.00 150.... |
| correct output |
|---|
| 150.000000000 358.113883008 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| 150.00 1.00 100.00 15.00 415.0... |
| correct output |
|---|
| 500.000000000 500.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 6
Verdict: RUNTIME ERROR
| input |
|---|
| 50.00 5.00 2.00 2.00 40.00 |
| correct output |
|---|
| 40.000000000 40.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 7
Verdict: RUNTIME ERROR
| input |
|---|
| 50.00 5.00 2.00 2.00 50.00 |
| correct output |
|---|
| 50.000000000 61.925824036 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 8
Verdict: RUNTIME ERROR
| input |
|---|
| 50.00 5.00 2.00 2.00 65.00 |
| correct output |
|---|
| 78.642080737 78.642080737 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 9
Verdict: RUNTIME ERROR
| input |
|---|
| 10.00 1.00 3.00 3.00 3.00 |
| correct output |
|---|
| 3.000000000 3.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 10
Verdict: RUNTIME ERROR
| input |
|---|
| 10.00 1.00 3.00 3.00 10.00 |
| correct output |
|---|
| 10.000000000 13.830951895 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 11
Verdict: RUNTIME ERROR
| input |
|---|
| 10.00 1.00 3.00 3.00 16.00 |
| correct output |
|---|
| 20.539392014 20.539392014 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 12
Verdict: RUNTIME ERROR
| input |
|---|
| 10.00 1.00 3.00 3.00 25.00 |
| correct output |
|---|
| 30.000000000 30.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 13
Verdict: RUNTIME ERROR
| input |
|---|
| 10.00 1.00 3.00 3.00 33.00 |
| correct output |
|---|
| 38.214967272 38.214967272 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 14
Verdict: RUNTIME ERROR
| input |
|---|
| 1.00 2.00 3.00 2.00 5.00 |
| correct output |
|---|
| 14.588723439 14.588723439 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 15
Verdict: RUNTIME ERROR
| input |
|---|
| 6.00 2.00 3.00 2.00 7.00 |
| correct output |
|---|
| 14.520797289 14.520797289 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 16
Verdict: RUNTIME ERROR
| input |
|---|
| 11.00 2.00 3.00 2.00 11.00 |
| correct output |
|---|
| 11.000000000 17.152067348 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 17
Verdict: RUNTIME ERROR
| input |
|---|
| 16.00 2.00 3.00 2.00 15.00 |
| correct output |
|---|
| 15.000000000 15.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 18
Verdict: RUNTIME ERROR
| input |
|---|
| 21.00 2.00 3.00 2.00 15.00 |
| correct output |
|---|
| 15.000000000 15.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 19
Verdict: RUNTIME ERROR
| input |
|---|
| 26.00 2.00 3.00 2.00 15.00 |
| correct output |
|---|
| 15.000000000 15.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 20
Verdict: RUNTIME ERROR
| input |
|---|
| 31.00 2.00 3.00 2.00 15.00 |
| correct output |
|---|
| 15.000000000 15.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 21
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 1.00 1.00 10.00 |
| correct output |
|---|
| 10.000000000 10.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 22
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 1.00 2.00 10.00 |
| correct output |
|---|
| 10.000000000 10.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 23
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 1.00 3.00 10.00 |
| correct output |
|---|
| 10.000000000 10.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 24
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 2.00 1.00 20.00 |
| correct output |
|---|
| 20.000000000 20.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 25
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 2.00 2.00 20.00 |
| correct output |
|---|
| 20.000000000 20.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 26
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 2.00 3.00 20.00 |
| correct output |
|---|
| 20.000000000 20.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 27
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 3.00 1.00 26.00 |
| correct output |
|---|
| 28.789826123 28.789826123 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 28
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 3.00 2.00 25.00 |
| correct output |
|---|
| 25.000000000 30.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 29
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 3.00 3.00 25.00 |
| correct output |
|---|
| 25.000000000 32.365424624 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 30
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 4.00 1.00 34.00 |
| correct output |
|---|
| 38.852299546 38.852299546 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 31
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 4.00 2.00 32.00 |
| correct output |
|---|
| 38.852299546 38.852299546 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 32
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 4.00 3.00 30.00 |
| correct output |
|---|
| 38.852299546 38.852299546 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 33
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 3.00 2.00 25.00 |
| correct output |
|---|
| 25.000000000 30.000000000 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 34
Verdict: RUNTIME ERROR
| input |
|---|
| 25.00 2.00 3.00 3.00 25.00 |
| correct output |
|---|
| 25.000000000 32.365424624 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 35
Verdict: RUNTIME ERROR
| input |
|---|
| 5.00 7.00 0.01 2.00 6.00 |
| correct output |
|---|
| 20.052545857 20.052545857 |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
Test 36
Verdict: RUNTIME ERROR
| input |
|---|
| 0.01 1000.00 1000.00 1000.00 1... |
| correct output |
|---|
| 2000999.995002499 2000999.9950... |
| user output |
|---|
| (empty) |
Error:
Error: Could not find or load main class Cses
