ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1020. Rope

JAVA, test 3, what is wrong?
Posted by ssau6207Voekov 18 Nov 2015 01:50
import java.io.*;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Math.*;

public class p2015_11_17_DZnaOlympSSAU_Timus1020_Thread implements Runnable {

final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

PrintWriter out;
StringTokenizer tok = new StringTokenizer("");

void init() throws FileNotFoundException {
if (ONLINE_JUDGE) {
out = new PrintWriter(System.out);
} else {
out = new PrintWriter("output.txt");
}
}

while (!tok.hasMoreTokens()) {
try {
} catch (Exception e) {
return null;
}
}
}

}

}

}

public static void main(String[] args) {
}

long timeBegin, timeEnd;

void time() {
timeEnd = System.currentTimeMillis();
System.err.println("Time = " + (timeEnd - timeBegin));
}

public void run() {
try {
timeBegin = System.currentTimeMillis();
init();
solve();
out.close();
time();
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
}
}

void solve() throws IOException {

if (numberOfNails==1){
} else {

double xLastNail=xFirstNail;
double yLastNail=yFirstNail;

double xOfTheCurrentNail=xFirstNail;
double yOfTheCurrentNail=yFirstNail;

for (int currentNail = 2; currentNail <= numberOfNails; currentNail++) {
xLastNail=xOfTheCurrentNail;
yLastNail=yOfTheCurrentNail;