Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #pragma comment(linker, "/stack:64000000")
  3. #include <string>
  4. #include <vector>
  5. #include <map>
  6. #include <list>
  7. #include <iterator>
  8. #include <cassert>
  9. #include <set>
  10. #include <queue>
  11. #include <iostream>
  12. #include <sstream>
  13. #include <stack>
  14. #include <deque>
  15. #include <cmath>
  16. #include <memory.h>
  17. #include <cstdlib>
  18. #include <cstdio>
  19. #include <cctype>
  20. #include <algorithm>
  21. #include <utility>
  22. #include <time.h>
  23. #include <complex>
  24. using namespace std;
  25.  
  26. #define FOR(i, a, b) for(int i=(a);i<(b);i++)
  27. #define RFOR(i, b, a) for(int i=(b)-1;i>=(a);--i)
  28. #define FILL(A,value) memset(A,value,sizeof(A))
  29.  
  30. #define ALL(V) V.begin(), V.end()
  31. #define SZ(V) (int)V.size()
  32. #define PB push_back
  33. #define MP make_pair
  34. #define Pi 3.14159265358979
  35. #define x0 ikjnrmthklmnt
  36. #define y0 lkrjhkltr
  37. #define y1 ewrgrg
  38.  
  39. typedef long long Int;
  40. typedef unsigned long long UInt;
  41. typedef vector<int> VI;
  42. typedef pair<int, int> PII;
  43. typedef pair<Int, Int> PLL;
  44. typedef pair<double, double> PDD;
  45. typedef complex<double> base;
  46.  
  47. const int INF = 1000000000;
  48. const int BASE = 1000000007;
  49. const int MAX = 200;
  50. const int MAXV = 100007;
  51. const int MAXE = 100000;
  52. const int ADD = 1000000;
  53. const int MOD = 1000000007;
  54. const int CNT = 800;
  55.  
  56. int a[MAX][MAX];
  57.  
  58. int k , n;
  59.  
  60. bool check()
  61. {
  62. FOR(x1,0,n)
  63. FOR(y1,0,n)
  64. {
  65. if (!a[x1][y1]) continue;
  66. FOR(x2,x1 + 1, n)
  67. {
  68. if (!a[x2][y1]) continue;
  69. FOR(y2,y1 + 1 , n)
  70. {
  71. if (a[x1][y2] && a[x2][y2]) return 0;
  72. }
  73. }
  74. }
  75. return 1;
  76. }
  77.  
  78.  
  79. int main()
  80. {
  81. //freopen("in.txt", "r", stdin);
  82. //freopen("distance.in", "r", stdin);
  83. //freopen("distance.out", "w", stdout);
  84. //freopen("out.txt" , "w" , stdout);
  85.  
  86. k = 13;
  87. n = k * k;
  88.  
  89.  
  90. FOR(i,0,k)
  91. {
  92. FOR(j,0,k)
  93. {
  94. a[i][i * k + j] = 1;
  95. }
  96. }
  97.  
  98. FOR(t,1,k)
  99. {
  100. FOR(i,0,k)
  101. {
  102. FOR(j,0,k)
  103. {
  104. a[t * k + i][j * k + (i + (t - 1) * j) % k] = 1;
  105. }
  106. }
  107. }
  108.  
  109. n = min(n , 150);
  110.  
  111. int sum = 0;
  112. FOR(i,0,n)
  113. {
  114. FOR(j,0,n)
  115. {
  116. sum += a[i][j];
  117. }
  118. }
  119. //cout << sum << endl;
  120.  
  121. cout << n << endl;
  122. FOR(i,0,n)
  123. {
  124. FOR(j,0,n)
  125. {
  126. if (a[i][j])
  127. {
  128. cout << 'O';
  129. }
  130. else
  131. {
  132. cout << '.';
  133. }
  134. }
  135. cout << endl;
  136. }
  137.  
  138. //cout << check() << endl;
  139.  
  140. return 0;
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement