i use merge sort to solve this problem
but i can't figure out why i get WA
could someone help me ??
[c]
#include <stdio.h>
#include <stdlib.h>
int count;
struct measure{
int ans;
int num;
};
typedef struct measure Measure;
void mergeSort(char[],int, int);
void merge(char[],int, int, int);
void ...
Search found 3 matches
- Fri Oct 15, 2004 11:05 am
- Forum: Volume 6 (600-699)
- Topic: 612 - DNA Sorting
- Replies: 122
- Views: 33601
- Mon Dec 16, 2002 5:01 am
- Forum: Volume 3 (300-399)
- Topic: 350 - Pseudo-Random Numbers
- Replies: 56
- Views: 23291
pb350--why i got time exceeded
i don't knoe how to modify my source code.
Can someone please help me...
here is my source code
#include <stdio.h>
int main()
{
long int j,z,l,m,i,x,y;
int n=1;
scanf("%ld%ld%ld%ld",&z,&i,&m,&l);
while(z!=0 && i!=0 && m!=0 && l!=0){
x=l;
l=(z*l+i)%m;
for(j=1;l!=x;j++)
l=(z*l+i)%m ...
Can someone please help me...
here is my source code
#include <stdio.h>
int main()
{
long int j,z,l,m,i,x,y;
int n=1;
scanf("%ld%ld%ld%ld",&z,&i,&m,&l);
while(z!=0 && i!=0 && m!=0 && l!=0){
x=l;
l=(z*l+i)%m;
for(j=1;l!=x;j++)
l=(z*l+i)%m ...
- Mon Dec 16, 2002 4:58 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 317849
pb100--why I always get time exceeded
How can I modify my source code??
can someone please help me???
here is my souce code
#include <stdlib.h>
#include <stdio.h>
int main()
{
int m,n,i,x=0,a,c,d;
while(scanf("%d%d",&m,&n)==2){
if(m<n){
c=m;
d=n;
}
else{
c=n;
d=m;
}
for(i=c;i<=d;i++){
a=1;
while(i!=1){
if(i%2==1)
i=3 ...
can someone please help me???
here is my souce code
#include <stdlib.h>
#include <stdio.h>
int main()
{
int m,n,i,x=0,a,c,d;
while(scanf("%d%d",&m,&n)==2){
if(m<n){
c=m;
d=n;
}
else{
c=n;
d=m;
}
for(i=c;i<=d;i++){
a=1;
while(i!=1){
if(i%2==1)
i=3 ...