NCPC25 finished

This commit is contained in:
2025-10-04 16:00:04 +02:00
commit 39396cedd3
21 changed files with 918 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import com.kattis.ncpc25.log.rider.D;
import org.junit.jupiter.api.Test;
import java.awt.*;
import static org.junit.jupiter.api.Assertions.*;
public class DTest {
@Test
public void DTests()
{
assertTrue(testMaxDiff(D.getTotalLength(new Point[]{new Point(-1, -7), new Point(-1, -11), new Point(0, -9), new Point(2, 2), new Point(1, -2), new Point(-2, -1), new Point(3, 1), new Point(-1, -5), new Point(0, -3), new Point(-3, -11)}), 17.186912));
assertTrue(testMaxDiff(D.getTotalLength(new Point[]{new Point(1, 0), new Point(0,0), new Point(1,1)}), 2));
}
public boolean testMaxDiff(double value, double excpected)
{
if(value == excpected) return true;
return value <= excpected + Math.pow(10, -6) && value >= excpected - Math.pow(10, -6);
}
}