You are viewing a single comment's thread. Return to all comments →
Java 8 :
import java.util.Scanner; public class Solution { public static void main(final String[] args) { try (final Scanner in = new Scanner(System.in)) { int type = 0, a = 0; for (int n = in.nextInt(), m = in.nextInt(); m > 0; m--) { type ^= in.nextInt() - 1; a += (2 * type - 1) * in.nextInt() + n; a %= n; } System.out.println(type + 1 + " " + a); } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Xrange's Pancakes
You are viewing a single comment's thread. Return to all comments →
Java 8 :