Horje
cpp-variadics/problem? Code Example
cpp-variadics/problem?
#include <iostream>
using namespace std;

// Enter your code for reversed_binary_value<bool...>()
template <bool a> int reversed_binary_value() { return a; }

template <bool a, bool b, bool... d> int reversed_binary_value() {
  return (reversed_binary_value<b, d...>() << 1) + a;
}


template <int n, bool...digits>
struct CheckValues {
    static void check(int x, int y)
    {
        CheckValues<n-1, 0, digits...>::check(x, y);
        CheckValues<n-1, 1, digits...>::check(x, y);
    }
};

template <bool...digits>
struct CheckValues<0, digits...> {
    static void check(int x, int y)
    {
        int z = reversed_binary_value<digits...>();
        std::cout << (z+64*y==x);
    }
};

int main()
{
    int t; std::cin >> t;

    for (int i=0; i!=t; ++i) {
        int x, y;
        cin >> x >> y;
        CheckValues<6>::check(x, y);
        cout << "\n";
    }
}




Cpp

Related
Buy 2 Get 1 Free codechef solution in c++ Code Example Buy 2 Get 1 Free codechef solution in c++ Code Example
c+ - Dormir en millisecondes Code Example c+ - Dormir en millisecondes Code Example
#include<iostream>  using namespace std; main() {    char s[] = "Fine"; 	*s = 'N';        cout<<s<<endl; } Code Example #include<iostream> using namespace std; main() { char s[] = "Fine"; *s = 'N'; cout<<s<<endl; } Code Example
assegnare valori in c++ Code Example assegnare valori in c++ Code Example
c++ 2 dim array initialize Code Example c++ 2 dim array initialize Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11