Guest User

Untitled

a guest
Oct 7th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1.  
  2. import java.io.*;
  3. import java.util.*;
  4. import java.math.*;
  5. class Test
  6. {
  7. public static void main(String args[])throws IOException
  8. {
  9. BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  10. int N, T,i,j,k=0;
  11. int ck=0,s=0,e=0,em=0,m=0,mh=0,h=0;
  12. String[] con= {"cakewalk","simple","easy","easy-medium","medium","medium-hard","hard"};
  13. T=Integer.parseInt(br.readLine());
  14. String[] result=new String[T];
  15. Random rn=new Random();
  16. for(i=1;i<=T;i++)
  17. {
  18. N=Integer.parseInt(br.readLine());
  19. for(j=1;j<=N;j++)
  20. {
  21. int index = rn.nextInt(con.length);
  22. String con1=con[index];
  23. System.out.println(con[index]);
  24.  
  25. if (con1.equals( "cakewalk"))
  26. {
  27. ++ck;
  28. }
  29. else if(con1.equals( "simple"))
  30. {
  31. ++s;
  32. }
  33. else if(con1.equals("easy"))
  34. {
  35. ++e;
  36. }
  37. else if(con1.equals("easy-medium"))
  38. {
  39. ++em;
  40. }
  41. else if(con1.equals("medium"))
  42. {
  43. ++m;
  44. }
  45. else if(con1.equals("medium-hard"))
  46. {
  47. ++mh;
  48. }
  49. else if(con1.equals("hard"))
  50. {
  51. ++h;
  52. }
  53. //System.out.println(ck+""+s+""+e+""+em+""+m+""+mh+""+h);
  54.  
  55. }
  56. if((ck!=0&& s!=0 && e!=0 && em!=0 && m!=0 && mh!=0 && h!=0)||(ck!=0 && s!=0 && e!=0 && em!=0 && mh!=0 && h!=0)||(ck!=0 && s!=0 && e!=0 && m!=0 && mh!=0 && h!=0)||(ck!=0 && s!=0 && e!=0 && em!=0 && m!=0 && h!=0)||(ck!=0 && s!=0 && e!=0 && em!=0 && m!=0 && mh!=0))
  57. {
  58. result[k]="Yes";
  59. k++;
  60. }
  61. else
  62. {
  63. result[k]="No";
  64. k++;
  65. }
  66.  
  67.  
  68. }
  69. for(i=0;i<result.length;i++)
  70. {
  71. System.out.println(result[i]);
  72. }
  73. }
  74. }
  75.  
  76. /* Output:
  77.  
  78. 3
  79. 5
  80. simple
  81. easy-medium
  82. cakewalk
  83. medium-hard
  84. cakewalk
  85. 7
  86. simple
  87. hard
  88. easy
  89. hard
  90. cakewalk
  91. medium
  92. simple
  93. 7
  94. easy-medium
  95. easy
  96. easy
  97. medium
  98. medium-hard
  99. easy-medium
  100. cakewalk
  101. No
  102. Yes
  103. Yes
  104.  
  105. Process finished with exit code 0
  106.  
  107. */
Add Comment
Please, Sign In to add comment