Search found 22 matches
- Sun May 13, 2012 8:09 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10450 - World Cup Noise
- Replies: 42
- Views: 25403
Re: 10450 - World Cup Noise
#include <iostream> #include <cmath> using namespace std; long long fib(int n){ return 0.447213595 * pow(1.61803399, (double)n) - 0.447213595 * pow(-0.618033989, (double)n); } int main(){ int t; cin >> t; for (int tt = 1; tt <= t; tt++){ int n; cin >> n; cout << "Scenario #" << tt << &quo...
- Sat May 05, 2012 5:43 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10954 - Add All
- Replies: 80
- Views: 38749
Re: 10954 - Add All
Thank you very much Brian.
- Sun Apr 29, 2012 8:00 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10954 - Add All
- Replies: 80
- Views: 38749
Re: 10954 - Add All
error C2064: term does not evaluate to a function taking 2 arguments xutility
I got this error with this code:
I got this error with this code:
Code: Select all
removed after AC
- Sun Apr 29, 2012 7:20 pm
- Forum: Volume 119 (11900-11999)
- Topic: 11965 - Extra Spaces
- Replies: 31
- Views: 11225
Re: 11965 - Extra Spaces
procedure Shift(var s: ansistring; ind: Integer); var i: Integer; begin for i := ind to length(s) do s[i] := s[i + 1]; setlength(s, length(s) - 1); end; var i, j, t, tt, n: Integer; s: ansistring; begin Readln(t); for tt := 1 to t do begin Readln(n); Writeln('Case ', tt, ':'); for i := 1 to n do be...
- Sat Apr 28, 2012 5:26 am
- Forum: Volume 109 (10900-10999)
- Topic: 10954 - Add All
- Replies: 80
- Views: 38749
Re: 10954 - Add All
How to find two smallest?
- Fri Apr 27, 2012 10:34 am
- Forum: Volume 109 (10900-10999)
- Topic: 10954 - Add All
- Replies: 80
- Views: 38749
Re: 10954 - Add All
#include <iostream> #include <algorithm> #include <queue> using namespace std; int main(){ int n; cin >> n; while (!n == 0){ priority_queue<int> a; int b; int cost = 0; int sum = 0; if (n == 2){ int c; cin >> b >> c; cout << b + c; } else{ for (int i = 1; i <= n; i++){ cin >> b; a.push(b); } while ...
- Fri Apr 27, 2012 9:08 am
- Forum: Volume 119 (11900-11999)
- Topic: 11965 - Extra Spaces
- Replies: 31
- Views: 11225
Re: 11965 - Extra Spaces
Input: 1 1 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567...
- Wed Apr 25, 2012 6:30 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10954 - Add All
- Replies: 80
- Views: 38749
Re: 10954 - Add All
#include <iostream> #include <algorithm> #include <queue> using namespace std; int main(){ int n; cin >> n; while (!n == 0){ priority_queue<int> a; int b; int cost = 0; int sum = 0; if (n == 2){ int c; cin >> b >> c; cout << b + c; } else{ for (int i = 1; i <= n; i++){ cin >> b; a.push(b); } for (i...
- Wed Apr 25, 2012 6:07 pm
- Forum: Volume 119 (11900-11999)
- Topic: 11900 - Boiled Eggs
- Replies: 14
- Views: 4012
Re: 11900
thnx
- Wed Apr 25, 2012 5:54 pm
- Forum: Volume 119 (11900-11999)
- Topic: 11965 - Extra Spaces
- Replies: 31
- Views: 11225
Re: 11965 - Extra Spaces
procedure Shift(var s: string; ind: Integer); var i: Integer; begin for i := ind to length(s) do s[i] := s[i + 1]; setlength(s, length(s) - 1); end; var i, j, t, tt, n: Integer; s: string; begin Readln(t); for tt := 1 to t do begin Readln(n); Writeln('Case ', tt, ':'); for i := 1 to n do begin Read...
- Wed Apr 25, 2012 5:43 pm
- Forum: Volume 114 (11400-11499)
- Topic: 11479 - Is this the easiest problem?
- Replies: 48
- Views: 24825
- Tue Apr 24, 2012 6:44 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10954 - Add All
- Replies: 80
- Views: 38749
Re: 10954 - Add All
I don't know what is this?brianfry713 wrote:Use a priority_queue.
- Tue Apr 24, 2012 6:41 pm
- Forum: Volume 119 (11900-11999)
- Topic: 11900 - Boiled Eggs
- Replies: 14
- Views: 4012
Re: 11900
AC
- Tue Apr 24, 2012 6:34 pm
- Forum: Volume 119 (11900-11999)
- Topic: 11965 - Extra Spaces
- Replies: 31
- Views: 11225
Re: 11965 - Extra Spaces
procedure Shift(var s: string; ind: Integer); var i: Integer; begin for i := ind to length(s) do s[i] := s[i + 1]; setlength(s, length(s) - 1); end; var i, j, t, tt, n: Integer; s: string; begin Readln(t); for tt := 1 to t do begin Readln(n); Writeln('Case ', tt, ':'); for i := 1 to n do begin Read...
- Mon Apr 23, 2012 8:40 pm
- Forum: Algorithms
- Topic: Total Number Of Divisors
- Replies: 6
- Views: 5069
Re: Total Number Of Divisors
Doesn't it take time as much as Seyedparsa's algorithm?