## Search found 7 matches

Wed Jun 20, 2007 5:07 pm
Forum: Volume 101 (10100-10199)
Topic: 10128 - Queue
Replies: 9
Views: 7758
Hello there, I've been trying to solve this problem for a while, but i couldn't figure out how to achieve any results... As far as i've understood, the idea is to find the range of places where the tallest person can be, and then loop through it calculating how many ways people can stay in front and...
Sat Apr 21, 2007 8:40 pm
Forum: Volume 104 (10400-10499)
Topic: 10489 - Boxes of Chocolates
Replies: 28
Views: 8173
thanks
got ac [=
Sat Apr 21, 2007 8:34 pm
Forum: Volume 104 (10400-10499)
Topic: 10489 - Boxes of Chocolates
Replies: 28
Views: 8173
Could you help me with 10489? This is my code, and i'm getting wa... #include <iostream> using namespace std; int main(){ int t,n,b,k,aux; long result; cin>>t; for(int i=0;i<t;i++){ cin>>n; cin>>b; long total = 0; for(int j=0;j<b;j++){ long partial = 1; cin>>k; for(int m=0;m<k;m++){ cin>>aux; partia...
Sat Apr 21, 2007 8:06 pm
Forum: Volume 4 (400-499)
Topic: 412 - Pi
Replies: 104
Views: 17946
hey
I thought I had already submitted the code without these two lines, but I hadn't. Now got ac.
Thanks a lot.
Sat Apr 21, 2007 8:03 pm
Forum: Volume 4 (400-499)
Topic: 412 - Pi
Replies: 104
Views: 17946
hi there, i got the output you said if i comment the following lines: if(i>0 && spaces[i]==spaces[i-1]) count--; else if(j>0 && spaces[j]==spaces[j-1]) count--; but this way, if the set is 2 2 3 4 5, i'll consider combinations like 2,5 twice... Is this right? Anyways, I tried to submit it without th...
Sat Apr 21, 2007 6:53 pm
Forum: Volume 4 (400-499)
Topic: 412 - Pi
Replies: 104
Views: 17946
i'm getting wa for this code... also tried what they say on other posts like not counting repeated numbers and using double. Still don't work.. #include <iostream> #include <math.h> #include <stdio.h> #include <algorithm> using namespace std; int mdc(int a,int b){ if(b>a) return mdc(b,a); if(a%b == ...
Fri Apr 06, 2007 8:01 pm
Forum: Volume 100 (10000-10099)
Topic: 10023 - Square root
Replies: 121
Views: 27550

### Hi there

I've implemented it as you say, with pell's equation, but still get TLE.. This is the code: int main(){ string result; string input; string left; string toDo; string group; string count; string a,b; int n,x,y; cin>>n; for(int i=0;i<n;i++){ cin>>input; x = input.length(); result = "0"; left = "0"; to...