Search found 16 matches

by Andrey
Thu Mar 24, 2005 10:55 am
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 65230

!

Why my code get WA???????

Here my code:

#include <iostream.h>

long long a[11][101];
int n,m;

int min(int y,int x)
{
int y1=y-1,y2=y+1;
if (y1==0) y1=m;if (y2==m+1) y2=1;
if (a[y1][x]<=a[y][x]&&a[y1][x]<=a[y2][x]) return y1;
else if (a[y][x]<=a[y2][x]&&a[y][x]<=a[y1][x]) return y;
else ...
by Andrey
Thu Mar 24, 2005 10:40 am
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 65230

!

My C++ code outputs same answers about the set of input

Code: Select all

8 
-1 
1 1 1 1 1 1 1 1 1 1 
-10 
1 5 
2 
2 1 2 1 2 
2 
1 
-7 
1 1 6 5 4 3 
8 
2 3 4 5 4 3 
7 
1 1 1 1 6 5 
10 
1 1 1 1 1 1 1 1 1 1 
1073741823 
I also get WA! I don't understand why???
by Andrey
Wed Mar 23, 2005 7:03 pm
Forum: Volume 108 (10800-10899)
Topic: 10832 - Yoyodyne
Replies: 6
Views: 3656

Thank you very much!!

Finally, i got AC!!!!!
by Andrey
Wed Mar 23, 2005 4:15 pm
Forum: Volume 108 (10800-10899)
Topic: 10832 - Yoyodyne
Replies: 6
Views: 3656

!

The next buoy to visit is determined by the closest buoy in the mission that has not yet been visited. In case of a tie, the buoy information that comes first in the input is given preference.
I don't understand this sentence, please say this in other words!! :oops:

Thank you!!!
by Andrey
Wed Mar 23, 2005 2:48 pm
Forum: Volume 108 (10800-10899)
Topic: 10830 - A New Function
Replies: 33
Views: 19029

I change line

Code: Select all

long  n,t,i,s=0; 
to line

Code: Select all

long long n,t,i,s=0;
And got AC!!!

Thank's Emilio !!
And others!!

Sorry for my English!!! :oops:
by Andrey
Wed Mar 23, 2005 11:45 am
Forum: Volume 108 (10800-10899)
Topic: 10832 - Yoyodyne
Replies: 6
Views: 3656

I test my code on this tests!
I can't find mistake!!!

Can anybody help me??
by Andrey
Wed Mar 23, 2005 11:13 am
Forum: Volume 108 (10800-10899)
Topic: 10830 - A New Function
Replies: 33
Views: 19029

WHY WA?

For this input

Code: Select all

1
2
3
4
5
6
7
8
9
10
0
I get this output:

Code: Select all

Case 1: 0
Case 2: 0
Case 3: 0
Case 4: 2
Case 5: 2
Case 6: 7
Case 7: 7
Case 8: 13
Case 9: 16
Case 10: 23
I think it's right, isn't it???
by Andrey
Wed Mar 23, 2005 9:28 am
Forum: Volume 108 (10800-10899)
Topic: 10832 - Yoyodyne
Replies: 6
Views: 3656

10832 - Yoyodyne

Please HELP!!!! :oops: :oops:
by Andrey
Tue Mar 22, 2005 10:32 pm
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 65230

Help!! Problem 116!! Critical i/o!!

For the input

12 14
1 2 2 1 1 1 1 1 1 1 1 1 1 2
1 1 2 2 1 1 1 1 1 1 1 1 1 1
1 1 1 2 2 1 1 1 1 1 1 1 1 1
1 1 1 1 2 2 1 1 1 1 1 1 1 1
1 1 1 1 1 2 2 1 1 1 1 1 1 1
1 1 1 1 1 1 2 2 1 1 1 1 1 1
1 1 1 1 1 1 1 2 2 1 1 1 1 1
1 1 1 1 1 1 1 1 2 2 1 1 1 1
1 1 1 1 1 1 1 1 1 2 2 1 1 1
1 1 1 1 1 1 1 1 ...
by Andrey
Tue Mar 22, 2005 7:41 pm
Forum: Volume 1 (100-199)
Topic: 128 - Software CRC
Replies: 62
Views: 14549

Problem 128!!!! Software CRC!!!

I don't understand the explanation for this problem!!

Please help me!!

Sorry for my english!!
:oops: :oops: :oops:
by Andrey
Mon Mar 14, 2005 8:46 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 163
Views: 50327

It's number 113 :oops: [/b]
by Andrey
Sun Mar 13, 2005 8:19 pm
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 163
Views: 50327

Can anybody help me?

why this code got AC

#include<stdio.h>
#include<math.h>

void main()
{
double n,p;
while(scanf("%lf %lf",&n,&p)==2)
{printf("%.lf\n",floor(pow(p,1.0/n)+0.5));}
}


And this WA


#include<iostream.h>
#include<math.h>

void main()
{
double n,p;
while(cin>>n>>p) cout<<floor(pow(p,1.0/n)+0 ...
by Andrey
Sun Mar 13, 2005 7:35 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 51123

Thank u very much, i got AC!
by Andrey
Sun Mar 13, 2005 7:30 pm
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 59948

495! Please help!

i got TLE, why?

#include <iostream.h>

void main()
{
int n,a[1050],b[1050],c[1050],i,s,t;
while (cin>>n)
{
for (i=1;i<1050;i++) { a[i]=0; b[i]=0; }
a[0]=1;a[1]=1;
b[0]=1;b[1]=1;
c[0]=1;c[1]=1;
if (n==0) c[1]=0;
for (t=3;t<=n;t++)
{
s=0;
c[0]=b[0];
for (i=1;i<=c[0];i++)
{
c[i]=(a[i ...
by Andrey
Thu Mar 10, 2005 9:33 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 51123

Please HELP! 371 WA

What's wrong in my code?

#include <iostream.h>

void main()
{
long long i,j,n,max,v,c,t,tmp;
cin>>i>>j;
while(i!=0)
{
v=-1;
max=0;
if(i>j) {tmp=j;j=i;i=tmp;}
for(t=i;t<=j;t++)
{
c=0;
n=t;
while(n!=1)
{
c++;
if(n%2==1) n=3*n+1;else n/=2;
}
if(c>max||v==-1) {max=c;v=t;}
}
cout ...

Go to advanced search