Skip to content

Instantly share code, notes, and snippets.

@Vicfred
Last active August 29, 2015 13:56
Show Gist options
  • Save Vicfred/8806442 to your computer and use it in GitHub Desktop.
Save Vicfred/8806442 to your computer and use it in GitHub Desktop.
Snapper Chain
//https://code.google.com/codejam/contest/433101/dashboard#s=p0
#include <cstdio>
using namespace std;
int main() {
int t, n, k;
scanf("%d", &t);
for(int i = 1; i <= t; i++) {
scanf("%d %d", &n, &k);
printf("Case #%d: %s\n", i, (((k+1) & ((1<<n)-1)) == 0) ? "ON" : "OFF");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment