Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ll tilings1(int n, int m) {
- n = (n & 1) ? (n + 1) >> 1 : n >> 1;
- m = (m & 1) ? (m + 1) >> 1 : m >> 1;
- ld ans = 1.0;
- for (int i = 1; i <= n; i++) {
- for (int j = 1; j <= m; j++) {
- ans *= 4 * (cos(PI * i / (n + 1)) * cos(PI * i / (n + 1)) + cos(PI * j / (m + 1)) * cos(PI * j / (m + 1)));
- }
- }
- return llround(ans);
- }
Advertisement
Add Comment
Please, Sign In to add comment