Lang:G++
Edit1234567891011121314151617181920212223#include <bits/stdc++.h>template<typename T> inline bool Gosper_next(T& x) {if (!x) return false;unsigned long long lowbit = x & (-(long long)(x));unsigned long long ripple = lowbit + x;if (!ripple) return false;x = ripple | (((x ^ ripple) >> 2) / lowbit);return true;}inline int _7(int i) { assert(i < 32); return (1 << i) - 1; }int main() {int n;scanf("%d", &n);int x = _7(n);do {int mm = x & _7(6);int hh = x >> 6 & _7(5);if (mm < 60 && hh < 24) {printf("%02d:%02d\n", hh, mm);}} while (Gosper_next(x) && x >> 11 == 0);}