Advertisement
hopingsteam

Untitled

Apr 8th, 2020
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.13 KB | None | 0 0
  1. #include    <iostream>
  2. #include    <cstring>
  3.  
  4. using namespace std;
  5.  
  6. /*
  7.  * n^m
  8.  * 14^x
  9.  */
  10.  
  11. int ucPut(int n, int m)
  12. {
  13.      return 0;
  14. }
  15.  
  16. int ucFac(int n)
  17. {
  18.     if(n == 0 || n == 1)
  19.         return 1;
  20.     if(n == 2)
  21.         return 2;
  22.     if(n == 3)
  23.         return 6;
  24.     if(n == 4)
  25.         return 4;
  26.     if(n >= 5)
  27.         return 0;
  28. }
  29.  
  30. int sol(int n, int m)
  31. {
  32.     if(n >= 5)
  33.     {
  34.         int c = n % 10;
  35.         if(c == 3 || c == 7)
  36.         {
  37.             if(m % 4 == 0)
  38.                 return 1;
  39.             else
  40.                 return 0;
  41.         }
  42.         if(c == 9)
  43.         {
  44.             if(m % 2 == 0)
  45.                 return 1;
  46.             else
  47.                 return 0;
  48.         }
  49.     }
  50.     else
  51.     {
  52.         switch(n)
  53.         {
  54.             case 1:
  55.                 return 0;
  56.             case 2:
  57.                 return 0;
  58.             case 3:
  59.             {
  60.                 if(m % 4 == 3)
  61.                     return 1;
  62.                 else
  63.                     return 0;
  64.             }
  65.             case 4:
  66.                 return 0;
  67.         }
  68.     }
  69. }
  70.  
  71. int main()
  72. {
  73.  
  74.     return 0;
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement