hiho week 181 register

Ended

Participants:243

Verdict:Accepted
Score:100 / 100
Submitted:2017-12-21 18:01:41

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <cstdio>
using namespace std;
int getCnt(int num)
{
    int cnt = 0;
    while(num){
        if(num & 1)
            ++cnt;
        num >>= 1;
    }
    return cnt;
}
int main()
{
    int x;
    // freopen("week181_p1.in", "r", stdin);
    scanf("%d", &x);
    for(int i = 0; i < 24; ++i)
        for(int j = 0; j < 60; ++j)
            if(getCnt(i) + getCnt(j) == x)
                printf("%.2d:%.2d\n", i, j);
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX