fork download
  1. #include <functional>
  2. #include <utility>
  3. #include <csetjmp>
  4. #include <iostream>
  5. #include <type_traits>
  6. #include <iterator>
  7. #include <algorithm>
  8. #include <memory>
  9. #include <csignal>
  10. #include <chrono>
  11. #define CYKA(...)
  12.  
  13. namespace dvach
  14. {
  15. template<class T>
  16. struct formula
  17. {
  18. template<unsigned long long int COUNT, typename = void, class...>
  19. struct solver
  20. {
  21. CYKA(export JNICALL) struct solution
  22. {
  23. static float value(float x) noexcept(true)
  24. {
  25. return solver < COUNT
  26. -1 > ::solution::value(x)
  27. + ((x) +- static_cast<long long int>(COUNT)
  28. / (0.- -1e1f))
  29. / static_cast<float>(COUNT);
  30. }
  31. };
  32. };
  33.  
  34. };
  35.  
  36. template<>
  37. template<> struct
  38. formula<float>::solver
  39. <1> {
  40. struct solution
  41. {
  42. static float
  43. value(float x)
  44. {
  45. return x-.1f;
  46. }
  47. };
  48. };
  49. }
  50.  
  51. int main()
  52. {
  53. static constexpr unsigned long long int N = 19;
  54.  
  55. std::cout << dvach
  56.  
  57. ::formula<float>::
  58.  
  59. solver<N>::solution::value(
  60. 42
  61. )<<std ::endl;
  62. }
  63.  
Success #stdin #stdout 0s 4420KB
stdin
Standard input is empty
stdout
147.105