fork download
  1. // iostream is too mainstream
  2. #include <cstdio>
  3. // bitch please
  4. #include <iostream>
  5. #include <algorithm>
  6. #include <cstdlib>
  7. #include <vector>
  8. #include <set>
  9. #include <map>
  10. #include <queue>
  11. #include <stack>
  12. #include <list>
  13. #include <cmath>
  14. #include <iomanip>
  15. #define dibs reserve
  16. #define OVER9000 1034567890
  17. #define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
  18. #define tisic 47
  19. #define soclose 1e-6
  20. #define chocolate win
  21. #define pi 3.14159265359
  22. // so much chocolate
  23. #define patkan 9
  24. #define ff first
  25. #define ss second
  26. #define abs(x) ((x < 0)?-(x):x)
  27. #define uint unsigned int
  28. using namespace std;
  29. // mylittledoge
  30.  
  31. int main() {
  32. cin.sync_with_stdio(0);
  33. cin.tie(0);
  34. string s;
  35. while(cin >> s) {
  36. if(s == "END") return 0;
  37. int L =51;
  38. vector<string> H(L);
  39. for(int i =0; i < L*L; i++) H[i/L] +=' ';
  40. for(int i =0; i < L; i++) H[0][i] =H[i][0] =H[L-1][i] =H[i][L-1] ='X';
  41. for(int i =0; i < L; i +=10) H[0][i] =H[i][0] =H[L-1][i] =H[i][L-1] ='@';
  42. H[2][L/2-1] ='1';
  43. H[2][L/2+1] ='2';
  44. H[L/2][2] ='9';
  45. H[L/2][L-3] ='3';
  46. H[L-3][L/2] ='6';
  47. H[L/2][L/2] ='*';
  48.  
  49. int m;
  50. if(s[1] == ':') m =10*(s[2]-'0')+(s[3]-'0')+60*(s[0]-'0');
  51. else m =(10*(s[3]-'0')+(s[4]-'0')+60*(s[1]-'0')+600*(s[0]-'0'))%(60*12);
  52. double angH =m*0.5, angM =(m%60)*6;
  53.  
  54. int px =1, py =-1;
  55. if(angH > 90 && angH < 180+soclose) py =1;
  56. if(angH >= 180-soclose && angH <= 270+soclose) py =1, px =-1;
  57. if(angH >= 270-soclose) px =-1, py =-1;
  58. double angA =min(360-angH,angH);
  59. if(angH > 90 && angH < 270) angA =abs(angH-180);
  60.  
  61. if(angA < 45)
  62. for(int i =3; i < L/2; i++) {
  63. double x =(L/2-i)*tan(angA*pi/180);
  64. H[L/2+(L/2-i)*py][L/2+int(round(x))*px] ='o';}
  65. else
  66. for(int j =L/2+1; j < L-3; j++) {
  67. double y =(j-L/2)/tan(angA*pi/180);
  68. H[L/2+int(round(y))*py][L/2+(j-L/2)*px] ='o';}
  69.  
  70. for(int i =1; i < L-1; i++) for(int j =1; j < L-1; j++) if(H[i][j] == 'o') {
  71. char c =H[i][j+1],c2 =H[i][j-1];
  72. if(c == 'o' || c == '|' || c == '-' || c == '/' || c == '\\' || c == '*')
  73. if(c2 == 'o' || c2 == '|' || c2 == '-' || c2 == '/' || c2 == '\\' || c2 == '*') {
  74. H[i][j] ='-';
  75. continue;}
  76. c =H[i-1][j],c2 =H[i+1][j];
  77. if(c == 'o' || c == '|' || c == '-' || c == '/' || c == '\\' || c == '*')
  78. if(c2 == 'o' || c2 == '|' || c2 == '-' || c2 == '/' || c2 == '\\' || c2 == '*') {
  79. H[i][j] ='|';
  80. continue;}
  81. c =H[i-1][j-1],c2 =H[i+1][j+1];
  82. if(c == 'o' || c == '|' || c == '-' || c == '/' || c == '\\' || c == '*')
  83. if(c2 == 'o' || c2 == '|' || c2 == '-' || c2 == '/' || c2 == '\\' || c2 == '*') {
  84. H[i][j] ='\\';
  85. continue;}
  86. c =H[i-1][j+1],c2 =H[i+1][j-1];
  87. if(c == 'o' || c == '|' || c == '-' || c == '/' || c == '\\' || c == '*')
  88. if(c2 == 'o' || c2 == '|' || c2 == '-' || c2 == '/' || c2 == '\\' || c2 == '*') {
  89. H[i][j] ='/';
  90. continue;}
  91. }
  92. for(int i =3; i < L-3; i++) for(int j =3; j < L-3; j++)
  93. if(H[i][j] != ' ' && (i-L/2)*(i-L/2)+(j-L/2)*(j-L/2) > 15*15) H[i][j] =' ';
  94.  
  95. px =1, py =-1;
  96. if(angM > 90 && angM < 180+soclose) py =1;
  97. if(angM >= 180-soclose && angM <= 270+soclose) py =1, px =-1;
  98. if(angM >= 270-soclose) px =-1, py =-1;
  99. angA =min(360-angM,angM);
  100. if(angM > 90 && angM < 270) angA =abs(angM-180);
  101.  
  102. if(angA < 45)
  103. for(int i =3; i < L/2; i++) {
  104. double x =(L/2-i)*tan(angA*pi/180);
  105. H[L/2+(L/2-i)*py][L/2+int(round(x))*px] ='o'+1;}
  106. else
  107. for(int j =L/2+1; j < L-3; j++) {
  108. double y =(j-L/2)/tan(angA*pi/180);
  109. H[L/2+int(round(y))*py][L/2+(j-L/2)*px] ='o'+1;}
  110.  
  111. for(int i =1; i < L-1; i++) for(int j =1; j < L-1; j++) if(H[i][j] == 'o'+1) {
  112. char c =H[i][j+1],c2 =H[i][j-1];
  113. if(c == 'o'+1 || c == '|'+1 || c == '-'+1 || c == '/'+1 || c == '\\'+1 || c == '*')
  114. if(c2 == 'o'+1 || c2 == '|'+1 || c2 == '-'+1 || c2 == '/'+1 || c2 == '\\'+1 || c2 == '*') {
  115. H[i][j] ='-'+1;
  116. continue;}
  117. c =H[i-1][j],c2 =H[i+1][j];
  118. if(c == 'o'+1 || c == '|'+1 || c == '-'+1 || c == '/'+1 || c == '\\'+1 || c == '*')
  119. if(c2 == 'o'+1 || c2 == '|'+1 || c2 == '-'+1 || c2 == '/'+1 || c2 == '\\'+1 || c2 == '*') {
  120. H[i][j] ='|'+1;
  121. continue;}
  122. c =H[i-1][j-1],c2 =H[i+1][j+1];
  123. if(c == 'o'+1 || c == '|'+1 || c == '-'+1 || c == '/'+1 || c == '\\'+1 || c == '*')
  124. if(c2 == 'o'+1 || c2 == '|'+1 || c2 == '-'+1 || c2 == '/'+1 || c2 == '\\'+1 || c2 == '*') {
  125. H[i][j] ='\\'+1;
  126. continue;}
  127. c =H[i-1][j+1],c2 =H[i+1][j-1];
  128. if(c == 'o'+1 || c == '|'+1 || c == '-'+1 || c == '/'+1 || c == '\\'+1 || c == '*')
  129. if(c2 == 'o'+1 || c2 == '|'+1 || c2 == '-'+1 || c2 == '/'+1 || c2 == '\\'+1 || c2 == '*') {
  130. H[i][j] ='/'+1;
  131. continue;}
  132. }
  133. for(int i =3; i < L-3; i++) for(int j =3; j < L-3; j++) {
  134. if(H[i][j] != ' ' && (i-L/2)*(i-L/2)+(j-L/2)*(j-L/2) > 21*21) H[i][j] =' ';
  135. if(H[i][j] == 'o'+1) H[i][j]--;
  136. if(H[i][j] == '|'+1) H[i][j]--;
  137. if(H[i][j] == '-'+1) H[i][j]--;
  138. if(H[i][j] == '/'+1) H[i][j]--;
  139. if(H[i][j] == '\\'+1) H[i][j]--;}
  140.  
  141. for(int i =0; i < L; i++) cout << H[i] << "\n";
  142. cout << "\n";}
  143. return 0;}
  144.  
  145. // look at my code
  146. // my code is amazing
Success #stdin #stdout 0s 3440KB
stdin
0:30
1:03
14:27
END
stdout
@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@
X                                                 X
X                       1 2                       X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
@                                                 @
X                            o                    X
X                           o                     X
X                           |                     X
X                           |                     X
X                           o                     X
X                          o                      X
X                          |                      X
X                          |                      X
X                          o                      X
@                         o                       @
X                         |                       X
X                         |                       X
X                         o                       X
X                        o                        X
X 9                      *                      3 X
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
@                        |                        @
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
@                        |                        @
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
X                        |                        X
X                                                 X
X                        6                        X
X                                                 X
@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@

@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@
X                                                 X
X                       1 2                       X
X                                                 X
X                                                 X
X                              o                  X
X                              |                  X
X                              |                  X
X                              o                  X
X                             o                   X
@                             |                   @
X                             o                   X
X                            o                    X
X                            |  o                 X
X                            o  o                 X
X                           o  o                  X
X                           |  o                  X
X                           o /                   X
X                          o o                    X
X                          | o                    X
@                          o/                     @
X                         oo                      X
X                         |o                      X
X                         o                       X
X                        oo                       X
X 9                      *                      3 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
@                                                 @
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
@                                                 @
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                        6                        X
X                                                 X
@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@

@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@
X                                                 X
X                       1 2                       X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
@                                                 @
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
X                                                 X
@                                                 @
X                                    o--          X
X                                 o-o             X
X                              o-o                X
X                          o--o                   X
X 9                      *o                     3 X
X                        o                        X
X                         o                       X
X                         |                       X
X                         o                       X
@                          o                      @
X                          |                      X
X                          o                      X
X                           o                     X
X                           |                     X
X                           o                     X
X                            o                    X
X                            |                    X
X                            o                    X
X                             o                   X
@                             |                   @
X                             o                   X
X                              o                  X
X                              |                  X
X                              |                  X
X                              o                  X
X                                                 X
X                                                 X
X                        6                        X
X                                                 X
@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@XXXXXXXXX@