gameRunner.setGameParameters(props);
gameRunner.addAgent(Player1.class);
- gameRunner.addAgent(PlayerRand.class);
+ gameRunner.addAgent(PlayerCheatSmart.class);
// gameRunner.addAgent("python3 /home/user/player.py");
import java.util.Random;
import java.util.Scanner;
-public class PlayerCheat {
+public class PlayerCheatPure {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Random random = new Random();
--- /dev/null
+import java.util.Random;
+import java.util.Scanner;
+
+public class PlayerCheatSmart {
+ public static void main(String[] args) {
+ Scanner in = new Scanner(System.in);
+ Random random = new Random();
+
+ int roadLength = in.nextInt();
+ int initialStones = in.nextInt();
+ in.nextLine();
+
+ while (true) {
+ int trollDistance = in.nextInt();
+ int stones = in.nextInt();
+ int opponentStones = in.nextInt();
+
+ int wantThrow = (roadLength - trollDistance + stones - 1) / stones;
+ int actualThrow = wantThrow > stones ? Integer.MIN_VALUE + 1
+ : wantThrow;
+ System.out.println(actualThrow);
+ }
+ }
+}