Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Previous12345…Next
- Username
- Prob
- Result
- Time
- (ms) Mem
- (MB) Lang
- Submit Time
- Blanzer
- A
- Accepted
- 990 15.4
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- Blanzer
- A
- Runtime error (SIGSEGV)
- C++
- 1 months ago
- Blanzer
- A
- Runtime error (SIGSEGV)
- C++
- 1 months ago
- Blanzer
- A
- Runtime error (SIGSEGV)
- C++
- 1 months ago
- Blanzer
- A
- Runtime error (SIGSEGV)
- C++
- 1 months ago
- Blanzer
- A
- Time limit exceeded
- C++
- 1 months ago
- All Copyright Reserved © 2010-2019 Xu Han
- Server Time: 2019-12-06 22:15:07 BST
- #22521054 | Blanzer's solution for [SPOJ-ASCDFIB] [Problem A]
- Status
- Accepted
- Time
- 990ms
- Memory
- 15360kB
- Length
- 719
- Lang
- C++14 (gcc 6.3)
- Submitted
- 2019-10-28 17:52:04
- Shared
- RemoteRunId
- 24708194
- Select Code
- #include <bits/stdc++.h>
- using namespace std;
- #define RANGE 1100001
- #define MOD 100000
- int fib[RANGE];
- int main()
- {
- ios_base::sync_with_stdio(false);
- int T,i,j,A,B,x;
- cin>>T;
- fib[0]=1;
- fib[1]=0;
- fib[2]=1;
- for(i=3;i<=RANGE;i++)
- {
- fib[i]=(fib[i-1]+fib[i-2])%MOD;
- }
- for(i=1;i<=T;i++)
- {
- priority_queue <int> PQ;
- cin>>A>>B;
- cout<<"Case "<<i<<":";
- for(j=A;j<=(A+B);j++)
- {
- PQ.push(-fib[j]);
- }
- x=PQ.size();
- if(x>100)
- {
- x = 100;
- }
- while(x--)
- {
- cout<<" "<<-PQ.top();
- PQ.pop();
- }
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement