Guest User

Untitled

a guest
Apr 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.63 KB | None | 0 0
  1. _____
  2. /
  3. /
  4. /
  5. /___
  6.  
  7. Input:
  8. 3 71%
  9. Output:
  10. _______
  11. x xx/
  12. xxx/
  13. x/
  14. /
  15. /
  16. /__xx_
  17.  
  18. Input:
  19. 5 52%
  20. Output:
  21. ___________
  22. /
  23. xx xx/
  24. xxxxx/
  25. xxx/
  26. x/
  27. /
  28. /
  29. /
  30. / xxx
  31. /xxxxxxxxx
  32.  
  33. Input:
  34. 6 75%
  35. Output:
  36. _____________
  37. x x/
  38. xxxxxxxxx/
  39. xxxxxxx/
  40. xxxxx/
  41. xxx/
  42. x/
  43. /
  44. /
  45. /
  46. /
  47. /
  48. /_xxxxxxxxx_
  49.  
  50. );' ': /(~:
  51. ;0=~100.@-
  52. .**/:t;'_':&&
  53. *.n
  54. ,{:y *.'\'+{[&'x':x]0t(:t>=}:S~
  55. (y-,{;S+S+.}%;'/'+++}%.{&/ *}%-1%{-1%x/ *&/x*}%) /&[*]++n*
  56.  
  57. 2n+1
  58.  
  59. x__xx/
  60. xxx/
  61. x/
  62.  
  63. /x
  64. /xxx
  65. /xx__x
  66.  
  67. /
  68. /
  69. / xx
  70.  
  71. /
  72. /
  73. /__xx_
  74.  
  75. #include<stdio.h>
  76. #include<memory.h>
  77. #include<stdlib.h>
  78. #define p printf
  79.  
  80. int h,c,*l,i,w,j,*q,k;const char*
  81. z;int main(int argc,char**argv)
  82. {h=atoi(argv[1]);c=(h*h*atoi(
  83. argv[2])+99)/100;l=new int[
  84. h*3];for(q=l,i=0,w=1;i<h;
  85. i++,c=(c-w)&~((c-w)>>31
  86. ),w+=2)if(c>=w){*q++=
  87. 0;*q++ =0;* q++=w;}
  88. else {*q++=(c+1)/
  89. 2;*q++=w-c;*q++
  90. =c/2;}p("_");
  91. for(i=0;i<h
  92. ;i ++)p (
  93. "__");p
  94. ("n"
  95. );q
  96. =
  97. l+h
  98. *3-1;
  99. for (i=
  100. --h;i>=0;
  101. i--){p("%*"
  102. "s\",h-i,"")
  103. ; z= "x x";
  104. for(k=0;k<3;k++,q
  105. --,z+=2)for(j=0;j<*
  106. q;j++)p(z);q-=0;p("/"
  107. "n");}q=l;for(i=0;i<=h
  108. ;i++){z =i==h? "_x_":
  109. " x ";p("%*s/",h-i,"");
  110. for(k=0;k<3;k++,q++,z+=2)for(
  111. j=0;j<*q;j++)p(z);p("\n") ;}}
  112.  
  113. #include <stdio.h>
  114. #include <memory.h>
  115. #include <stdlib.h>
  116.  
  117. #define p printf
  118.  
  119. int h, c, *l, i, w, j, *q, k;
  120. const char *z;
  121.  
  122. int main(int argc, char** argv)
  123. {
  124. h = atoi(argv [1]);
  125. c = (h*h*atoi(argv[2])+99)/100;
  126. l = new int[h*3];
  127. for (q = l,i = 0,w = 1; i<h; i++,c = (c-w)&~((c-w)>>31),w += 2) {
  128. if (c>=w) {
  129. *q++ = 0;
  130. *q++ = 0;
  131. *q++ = w;
  132. } else {
  133. *q++ = (c+1)/2;
  134. *q++ = w-c;
  135. *q++ = c/2;
  136. }
  137. }
  138. p("_");
  139. for (i = 0; i<h; i++) {
  140. p("__");
  141. }
  142. p("n");
  143. q = l+h*3-1;
  144. for (i = --h; i>=0; i--) {
  145. p("%*s\",h-i,"");
  146. z = "x x";
  147. for (k = 0; k<3; k++,q--,z += 2) {
  148. for (j = 0; j<*q; j++) {
  149. p(z);
  150. }
  151. }
  152. p("/n");
  153. }
  154. q = l;
  155. for (i = 0; i<=h; i++) {
  156. z = i==h ? "_x_" : " x ";
  157. p("%*s/",h-i,"");
  158. for (k = 0; k<3; k++,q++,z += 2) {
  159. for (j = 0; j<*q; j++) {
  160. p(z);
  161. }
  162. }
  163. p("\n") ;
  164. }
  165. }
  166.  
  167. $S=-int((1-.01*pop)*($N=pop)*$N)+$N*$N;$S-=$s=$S>++$r?$r:$S,
  168. $=$/.$"x$N."\".x x($v=$s/2).$"x($t=$r++-$s).x x($w=$v+.5)."/$
  169. ".$"x$N."/".($^=$N?$":_)x$w.x x$t.$^x$v."\"while$N--;print$^x++$r
  170.  
  171. $S=-int((1-.01*pop)*($N=pop
  172. ) *
  173. $ N
  174. ) +
  175. $ N
  176. *$N;( ${B},$
  177. F,${x})=qw(\ / x
  178. );while($N){;/l
  179. ater/g;$S-=$s
  180. =$S>++$r?$r
  181. :$S;'than
  182. you';@o
  183. =(" "
  184. x--
  185. $ N
  186. . $
  187. B .
  188. x x
  189. ( $
  190. v =
  191. $ s
  192. / 2
  193. ) .$"x($t= $
  194. r++-$s).x x($w=$v+.5)
  195. .$F,@o,$"x$N.$F.($^=$N?
  196. $":_)x$w.x x$t.$^x$v.$B);
  197. $,=$/}print$^x++$r,@o;think
  198.  
  199. N,p=map(int,raw_input()[:-1].split())
  200. S=N*N-N*N*(100-p)/100
  201. _,e,x,b,f,n=C='_ x/n'
  202. o=""
  203. r=1
  204. while N:N-=1;z=C[N>0];s=min(S,r);S-=s;t=r-s;v=s/2;w=s-v;r+=2;o=n+e*N+b+x*v+e*t+x*w+f+o+n+e*N+f+z*w+x*t+z*v+b
  205. print _*r+o
  206.  
  207. x n c=h s++'n':reverse(h(flip s)) where h s=r w '-'++s '+' b(w-2)0 p;w=(t n);p=d(n*n*c)100
  208. s x n i o p|i>0='n':l++s x n(i-2)(o+1)(max(p-i)0)|True=[] where l=r o b++'\':f d++r(i#p)n++f m++'/':r o b;f g=r(g(i-(i#p))2)x
  209. b=' '
  210. r=replicate
  211. t n=1+2*n
  212. d=div
  213. (#)=min
  214. m=(uncurry(+).).divMod
  215.  
  216. #include<iostream>
  217. #include<string>
  218. #include<cstdlib>
  219. #include<cmath>
  220. using namespace std;
  221. typedef string S;
  222. typedef int I;
  223. typedef char C;
  224. I main(I,C**v){
  225. I z=atoi(v[1]),c=z*z,f=ceil(c*atoi(v[2])/100.);
  226. cout<<S(z*2+1,'_')<<'n';
  227. for(I i=z,n=c;i;--i){
  228. I y=i*2-1;
  229. S s(y,' ');
  230. C*l=&s[0];
  231. C*r=&s[y];
  232. for(I j=0;j<y;++j)
  233. if(n--<=f)*((j&1)?l++:--r)='x';
  234. cout<<S(z-i,' ')<<'\'<<s<<"/n";
  235. }
  236. for(I i=1,n=c-f;i<=z;++i){
  237. I y=i*2-1;
  238. S s(y,'x');
  239. C*l=&s[0];
  240. C*r=&s[y];
  241. for(I j=0;j<y;++j)
  242. if(n++<c)*(!(j&1)?l++:--r)=(i==z)?'_':' ';
  243. cout<<S(z-i,' ')<<'/'<<s<<"\n";
  244. }
  245. }
  246.  
  247. #include<iostream>
  248. #include<string>
  249. #include<cstdlib>
  250. #include<cmath>
  251. using namespace std;typedef string S;typedef int I;typedef char C;I main(I,C**v){I z=atoi(v[1]),c=z*z,f=ceil(c*atoi(v[2])/100.);cout<<S(z*2+1,'_')<<'n';for(I i=z,n=c;i;--i){I y=i*2-1;S s(y,' ');C*l=&s[0];C*r=&s[y];for(I j=0;j<y;++j)if(n--<=f)*((j&1)?l++:--r)='x';cout<<S(z-i,' ')<<'\'<<s<<"/n";}for(I i=1,n=c-f;i<=z;++i){I y=i*2-1;S s(y,'x');C*l=&s[0];C*r=&s[y];for(I j=0;j<y;++j)if(n++<c)*(!(j&1)?l++:--r)=(i==z)?'_':' ';cout<<S(z-i,' ')<<'/'<<s<<"\n";}}
  252.  
  253. function f () { for i in `seq $1`;do printf "$2";done; }
  254. N=$1;S=$[$1*$1-$1*$1*$[100-${2/%/}]/100]
  255. b='';o=$b;n="n";r=1;while [ $N -gt 0 ];do
  256. N=$[N-1];z=" ";s=$r;[ $N -eq 0 ]&& z=_;[ $S -lt $r ]&& s=$S
  257. S=$[S-s];t=$[r-s];v=$[s/2];w=$[s-v];r=$[r+2]
  258. o=$n`f $N " "`$b`f $v x;f $t " ";f $w x`/$o$b$n`f $N " "`/`f $w "$z";f $t x;f $v "$z"`$b
  259. done;f $r _;echo -e "${o//\\//}"
  260.  
  261. Input Integer: 10
  262. When were you born? 23-May-1974
  263. _____________________
  264. /
  265. /
  266. /
  267. /
  268. /
  269. /
  270. /
  271. x xx/
  272. xxx/
  273. x/
  274. /
  275. /
  276. / xx
  277. /xxxxxxx
  278. /xxxxxxxxx
  279. /xxxxxxxxxxx
  280. /xxxxxxxxxxxxx
  281. /xxxxxxxxxxxxxxx
  282. /xxxxxxxxxxxxxxxxx
  283. /xxxxxxxxxxxxxxxxxxx
  284.  
  285. public class M{public static void main(String[] a){int h=Integer.parseInt(a[0]);int s=(int)Math.ceil(h*h*Integer.parseInt(a[1])/100.);r(h,h-1,s,true);r(h,h-1,s,false);}static void r(int h,int c,int r,boolean t){if(c<0)return;int u=2*(h-c)-1;if(t&&c==h-1)p(2*h+1,0,'_','_',true,0,false);int z=r>=u?u:r;r-=z;if(t)r(h,c-1,r,true);p(u,z,t?'x':((c==0)?'_':' '),t?' ':'x',t,c,true);if(!t)r(h,c-1,r,false);}static void p(int s,int n,char o,char i,boolean t,int p,boolean d){int f=(s-n);int q=n/2+(!t&&(f%2==0)?1:0);int e=q+f;String z = "";int j;for(j=0;j<p+4;j++)z+=" ";if(d)z+=t?'\':'/';for(j=0;j<s;j++)z+=(j>=q&&j<e)?i:o;if(d)z+=t?'/':'\';System.out.println(z);}}
  286.  
  287. <?$s=$argv[1];$x='str_pad';$w=$s*2-1;$o[]=$x('',$w+2,'_');
  288. $r=$s*ceil($w/2);$w=$r-($r*substr($argv[2],0,-1)/100);$p=0;
  289. $c=-1;while($s){$k=$s--*2-1;$f=$x($x('',min($k,$w),' '),$k,'x',2);
  290. $g=$x($x('',min($k,$w),'x'),$k,' ',2);$w-=$k;$o[]=$x('',$p)."\$f/";
  291. $b[]=$x('',$p++)."/$g\";}$b[0]=str_replace(' ','_',$b[0]);
  292. krsort($b);echo implode("n",array_merge($o,$b));?>
  293.  
  294. X,p=map(int,raw_input()[:-1].split())
  295. k=X*X;j=k*(100-p)/100
  296. n,u,x,f,b,s='n_x/ '
  297. S=list(x*k+s*j).pop;T=list(s*k+u*(2*X-j-1)+x*j).pop
  298. A=B=""
  299. for y in range(X):
  300. r=S();q=T()
  301. for i in range(X-y-1):r=S()+r+S();q+=T();q=T()+q
  302. A+=n+s*y+b+r+f;B=n+s*y+f+q+b+B
  303. print u+u*2*X+A+B
  304.  
  305. public class M {public static void Main(){int h = Convert.ToInt32(Console.ReadLine());
  306. int s = Convert.ToInt32(h * h * Convert.ToInt32(Console.ReadLine()) / 100);r(h,h-1,s,true);
  307. r(h,h-1,s,false);Console.ReadLine();}static void r(int h, int c, int r, bool t){
  308. if(c<0) return;int u=2*(h-c)-1;if (t&&c==h-1)p(2*h+1,0,'_','_',true,0,false);
  309. int z=r>=u?u:r; r-=z;if (t)M.r(h,c-1,r,true); p(u,z,t?'x':((c==0)?'_':' '), t?' ':'x',t,c,true);
  310. if(!t)M.r(h,c-1,r,false);}static void p(int s, int n, char o, char i, bool t, int p, bool d)
  311. {int f=(s-n);int q=n/2+(!t&&(f%2==0)?1:0);int e=q+f;string z="";int j;for(j=0;j<p+4;j++) z+=" ";if(d)z+=t?'\':'/';
  312. for (j=0;j<s;j++) z+=(j>=q&&j<e)?i:o; if(d)z+=t?'/':'\';Console.WriteLine(z);}}
  313.  
  314. n,p = $F.map{|i|i.to_i}
  315. r="n"
  316. y=''
  317. g,s,u,f,b=%w{x _ / \}
  318. $> << u*2*n+u+r # draw initial underbar line
  319. a=u
  320. c=100.0/n/n # amount of sand a single x represents
  321. e = 100.0 # percentage floor to indicate sand at this level
  322. n.times{ |i|
  323. d=2*n-1-2*i # number of spaces at this level
  324. e-= c*d # update percentage floor
  325. x = [((p - e)/c+0.5).to_i,d].min
  326. x = 0 if x<0
  327. w = x/2 # small half count
  328. z = x-w # big half count
  329. d = d-x # total padding count
  330. $> << s*i+b+g*w+s*d+g*z+f+r
  331. y=s*i+f+a*z+g*d+a*w+b+r+y
  332. a=s
  333. }
  334. $_=y
  335.  
  336. m,p=$F.map{|i|i.to_i}
  337. q=m*m-m*m*(100-p)/100
  338. _,e,x,b,f=%w{_ x \ /}
  339. n="n"
  340. o=''
  341. r=1
  342. while m>0
  343. m-=1
  344. z=m>0?e:_
  345. s=q<r ?q:r
  346. q-=s
  347. t=r-s
  348. v=s/2
  349. w=s-v
  350. r=r+2
  351. o=n+e*m+b+x*v+e*t+x*w+f+o+n+e*m+f+z*w+x*t+z*v+b
  352. end
  353. $_=_*r+o
Add Comment
Please, Sign In to add comment