bool_bool

Untitled

Nov 17th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. ll tilings1(int n, int m) {
  2. n = (n & 1) ? (n + 1) >> 1 : n >> 1;
  3. m = (m & 1) ? (m + 1) >> 1 : m >> 1;
  4. ld ans = 1.0;
  5. for (int i = 1; i <= n; i++) {
  6. for (int j = 1; j <= m; j++) {
  7. ans *= 4 * (cos(PI * i / (n + 1)) * cos(PI * i / (n + 1)) + cos(PI * j / (m + 1)) * cos(PI * j / (m + 1)));
  8. }
  9. }
  10. return llround(ans);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment