Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.92 KB | None | 0 0
  1. Previous12345…Next
  2. Username
  3. Prob
  4.     Result
  5.     Time
  6. (ms)    Mem
  7. (MB)    Lang
  8.     Submit Time
  9. Blanzer
  10. A
  11. Accepted
  12. 990 15.4   
  13. C++
  14. 1 months ago
  15. Blanzer
  16. A
  17. Time limit exceeded
  18. C++
  19. 1 months ago
  20. Blanzer
  21. A
  22. Time limit exceeded
  23. C++
  24. 1 months ago
  25. Blanzer
  26. A
  27. Time limit exceeded
  28. C++
  29. 1 months ago
  30. Blanzer
  31. A
  32. Time limit exceeded
  33. C++
  34. 1 months ago
  35. Blanzer
  36. A
  37. Time limit exceeded
  38. C++
  39. 1 months ago
  40. Blanzer
  41. A
  42. Time limit exceeded
  43. C++
  44. 1 months ago
  45. Blanzer
  46. A
  47. Time limit exceeded
  48. C++
  49. 1 months ago
  50. Blanzer
  51. A
  52. Time limit exceeded
  53. C++
  54. 1 months ago
  55. Blanzer
  56. A
  57. Time limit exceeded
  58. C++
  59. 1 months ago
  60. Blanzer
  61. A
  62. Runtime error (SIGSEGV)
  63. C++
  64. 1 months ago
  65. Blanzer
  66. A
  67. Runtime error (SIGSEGV)
  68. C++
  69. 1 months ago
  70. Blanzer
  71. A
  72. Runtime error (SIGSEGV)
  73. C++
  74. 1 months ago
  75. Blanzer
  76. A
  77. Runtime error (SIGSEGV)
  78. C++
  79. 1 months ago
  80. Blanzer
  81. A
  82. Time limit exceeded
  83. C++
  84. 1 months ago
  85.      
  86. All Copyright Reserved © 2010-2019 Xu Han
  87. Server Time: 2019-12-06 22:15:07 BST
  88.  
  89. #22521054 | Blanzer's solution for [SPOJ-ASCDFIB] [Problem A]
  90. Status
  91. Accepted
  92. Time
  93. 990ms
  94. Memory
  95. 15360kB
  96. Length
  97. 719
  98. Lang
  99. C++14 (gcc 6.3)
  100. Submitted
  101. 2019-10-28 17:52:04
  102. Shared
  103.  
  104. RemoteRunId
  105. 24708194
  106. Select Code
  107. #include <bits/stdc++.h>
  108.  
  109. using namespace std;
  110.  
  111. #define RANGE 1100001
  112. #define MOD 100000
  113.  
  114. int fib[RANGE];
  115.  
  116. int main()
  117. {
  118.     ios_base::sync_with_stdio(false);
  119.     int T,i,j,A,B,x;
  120.     cin>>T;
  121.     fib[0]=1;
  122.     fib[1]=0;
  123.     fib[2]=1;
  124.     for(i=3;i<=RANGE;i++)
  125.     {
  126.         fib[i]=(fib[i-1]+fib[i-2])%MOD;
  127.     }
  128.     for(i=1;i<=T;i++)
  129.     {
  130.         priority_queue <int> PQ;
  131.         cin>>A>>B;
  132.         cout<<"Case "<<i<<":";
  133.         for(j=A;j<=(A+B);j++)
  134.         {
  135.             PQ.push(-fib[j]);
  136.         }
  137.         x=PQ.size();
  138.         if(x>100)
  139.         {
  140.             x = 100;
  141.         }
  142.         while(x--)
  143.         {
  144.             cout<<" "<<-PQ.top();
  145.             PQ.pop();
  146.         }
  147.  
  148.         cout<<endl;
  149.     }
  150.     return 0;
  151. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement