Search found 22 matches

by Hasselli
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...
by Hasselli
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.
by Hasselli
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:

Code: Select all

removed after AC
by Hasselli
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...
by Hasselli
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?
by Hasselli
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 ...
by Hasselli
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...
by Hasselli
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...
by Hasselli
Wed Apr 25, 2012 6:07 pm
Forum: Volume 119 (11900-11999)
Topic: 11900 - Boiled Eggs
Replies: 14
Views: 4012

Re: 11900

thnx
by Hasselli
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...
by Hasselli
Tue Apr 24, 2012 6:44 pm
Forum: Volume 109 (10900-10999)
Topic: 10954 - Add All
Replies: 80
Views: 38749

Re: 10954 - Add All

brianfry713 wrote:Use a priority_queue.
I don't know what is this?
by Hasselli
Tue Apr 24, 2012 6:41 pm
Forum: Volume 119 (11900-11999)
Topic: 11900 - Boiled Eggs
Replies: 14
Views: 4012

Re: 11900

AC
by Hasselli
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...
by Hasselli
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?

Go to advanced search