Created
May 4, 2014 07:34
-
-
Save autekroy/f8ab5ad3687b7cd75a03 to your computer and use it in GitHub Desktop.
Google Code Jam - Round 1B 2014 - Problem B.New Lottery Game (small input)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Google Code Jam - Round 1B 2014 - Problem B.New Lottery Game (small input) | |
//https://code.google.com/codejam | |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<string.h> | |
#include<iostream> | |
using namespace std; | |
int main() | |
{ | |
//freopen ("b_output.txt","w",stdout); | |
int T, A, B, K, ans; | |
scanf("%d", &T); | |
for(int testCase = 1; testCase <= T; testCase++) | |
{ | |
printf("Case #%d: ", testCase); | |
ans = 0; | |
scanf("%d %d %d", &A, &B, &K); | |
for(int i = 0; i < A; i++) | |
{ | |
for(int j = 0; j < B; j++) | |
{ | |
int tmp = i & j; | |
if(tmp < K) | |
ans ++; | |
} | |
} | |
printf("%d\n", ans); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment