Search found 18 matches

by sir. manuel
Sun Oct 16, 2011 10:40 pm
Forum: Volume 9 (900-999)
Topic: 902 - Password Search
Replies: 68
Views: 32013

Re: 902 - Password Search

Why WA?????? #include<cstdio> #include<cstdlib> #include<iostream> #include<sstream> #include<cmath> #include<string> #include<cstring> #include<cctype> #include<algorithm> #include<vector> #include<bitset> #include<queue> #include<stack> #include<utility> #include<list> #include<set> #include<map> ...
by sir. manuel
Thu Sep 08, 2011 5:40 am
Forum: Volume 118 (11800-11899)
Topic: 11852 - Knight's Trip
Replies: 7
Views: 3408

Re: 11852 - Knight's Trip

i search it in the internet but i can´t find it!!!, so please can you send it to my email????....kavic1@hotmail.com


Thanks
by sir. manuel
Fri May 27, 2011 8:54 pm
Forum: Volume 113 (11300-11399)
Topic: 11385 - Da Vinci Code
Replies: 70
Views: 23490

Re: 11385 - Da Vinci Code

Solved!!!
I use binary search...
The worse error that i had was the "I consider all the nums as fibonaccis", you have to check if it's a fibo...
by sir. manuel
Fri May 27, 2011 7:45 am
Forum: Volume 113 (11300-11399)
Topic: 11385 - Da Vinci Code
Replies: 70
Views: 23490

Re: 11385 - Da Vinci Code

I think that my solution it's fine but i get WA!!!...this is a stupid problem, have a bad description!!!...very bad!!!! #include<stdio.h> #include<cstring> #include<cctype> #include<algorithm> #include<vector> #include<iostream> #define max 109 using namespace std; int main() { long long int fibo[ma...
by sir. manuel
Sun Jan 16, 2011 2:02 am
Forum: Volume 5 (500-599)
Topic: 531 - Compromise
Replies: 73
Views: 25554

Re: 531 - Compromise - WA

why TLE???? #include<stdio.h> #include<string> #include<cstring> #include<iostream> #include<vector> #include<algorithm> #include<sstream> using namespace std; vector<string>vec1,vec2; int path[5000][5000]; int a,b; void print(int i,int j) { if(i==0 || j==0){return;} if(path[i][j]==1){ print(i-1,j-1...
by sir. manuel
Fri Dec 31, 2010 6:57 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 36832

Re: 583 - Prime Factors

jejeje, i was trying to use a sieve, but that was stupid, 2^31 it´s a bg num....so i do this version...but iget WA....why???? #include<stdio.h> int main() { long long int num; long long int i,var; while(scanf("%lld",&num)==1 && num!=0){ int bandera=1; printf("%lld =",num); var=num; if(num<0){ printf...
by sir. manuel
Fri Dec 31, 2010 9:03 am
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 36832

Re: 583 - Prime Factors

I think that my code it´s fine!!!, but i get WA!!!, can you give me special cases???,,please!!! #include<stdio.h> #include<bitset> #include<vector> #include<map> #define L1 1000009 #define L2 1009 using namespace std; vector<long long int>primos; map<long long int,long long int>factores; bitset<L1>c...
by sir. manuel
Tue Dec 28, 2010 12:51 am
Forum: Algorithms
Topic: Maximum interval sum
Replies: 1
Views: 3334

Re: Maximum interval sum

This code,,,it's linear!!! n= number of elements maxsum=-INF; INF=it's the element minimum of all posibles cases sum=0; for(int i=0;i<n;i++){ scanf("%d",&element); if(sum>0){ sum+=element; } else{ sum=element; } if(sum>maxsum){maxsum=sum;} } maxsum it's the maximum sum!!! There is a algorithm of n²,...
by sir. manuel
Mon Dec 27, 2010 8:49 pm
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 162
Views: 16062

Re: 113 why not AC?

Code: Select all

#include<stdio.h>
#include<math.h>
int main()
{
double a,b;
while(scanf("%lf %lf",&a,&b)==2){
                                printf("%.0lf\n",pow(b,1/a));
                                } 
return 0;
}
Always use double!!!
by sir. manuel
Sun Dec 26, 2010 11:48 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 162
Views: 16062

Re: 113 why not AC?

try with pow(p,1/n)
by sir. manuel
Sun Dec 26, 2010 11:40 am
Forum: Volume 100 (10000-10099)
Topic: 10003 - Cutting Sticks
Replies: 59
Views: 24353

Re: 10003 - Cutting Sticks

libreiries...you need "string.h" to memset,,,too "stdio.h"
by sir. manuel
Sun Dec 26, 2010 10:57 am
Forum: Volume 100 (10000-10099)
Topic: 10032 - Tug of War
Replies: 91
Views: 32177

Re: 10032 - Tug of War

i did first the problem 562 with the knapsack....then a read the problem tug of war,,,but this problem it's totally diferent!!!...i tried with bactracking,,,,but i get TLE,,,so i trying with DP...but i don't see the recurrences...
by sir. manuel
Sun Dec 26, 2010 10:52 am
Forum: Volume 5 (500-599)
Topic: 507 - Jill Rides Again
Replies: 92
Views: 30031

Re: 507 - Jill rides again

I need help,,,my problem is that i don't know how to carry the index!!! In the case: 4 1 -1 1 my program return "from 3 to 4 "...and the solution is "from 1 to 4"...my problem is "If more than one segment is maximally nice, choose the one with the longest cycle ride (largest j-i)." #include<stdio.h>...
by sir. manuel
Sat Dec 25, 2010 12:56 am
Forum: Volume 100 (10000-10099)
Topic: 10032 - Tug of War
Replies: 91
Views: 32177

Re: 10032 - Tug of War

firts i think in the snakpsack,,,but the problem say "numbersTeamA-numbersTeamB<=1 "...how i can chance to algorithm of snapsack???
by sir. manuel
Sat Dec 25, 2010 12:46 am
Forum: Volume 3 (300-399)
Topic: 350 - Pseudo-Random Numbers
Replies: 56
Views: 16361

Re: 350

This problem it's easy, i used a little hash because i am training problems with hash,,,
You have to read the problem, and see, that YOU FIRTS HAVE TO GENARATE A SEED WITH L, then you can start to cont,,,

Go to advanced search