You are viewing a single comment's thread. Return to all comments →
A Java solution:
import java.util.Scanner; public class StrangeCounter { public static void main(String[] args) { Scanner in = new Scanner(System.in); long t = in.nextLong(), n = 2; while (3 * (n - 1) < t) n = 2 * n; System.out.println((3 * (n - 1) - t + 1)); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Counter
You are viewing a single comment's thread. Return to all comments →
A Java solution: