Search found 10 matches

by miracle
Fri May 13, 2005 4:04 pm
Forum: Algorithms
Topic: BeiJing 2004 : Color a Tree
Replies: 1
Views: 1548

BeiJing 2004 : Color a Tree

Using greedy algorithm , I konw it ,but how to design it ?
Anyone can help ?

The original site:
http://acm.pku.edu.cn/JudgeOnline/showproblem?problem_id=2054

Time Limit:1000MS Memory Limit:30000K

Bob is very interested in the data structure of a tree. A tree is a directed graph in which a ...
by miracle
Sat May 07, 2005 10:06 am
Forum: Algorithms
Topic: SOS , tell me the algorithm , thanks
Replies: 2
Views: 1373

SOS , tell me the algorithm , thanks

How to find the the smallest prime factor of N? Who can help me?


Prime Test

Time Limit:10000MS Memory Limit:10000K

Description

Given a big integer number, you are required to find out whether it's a prime number.
Input

The first line contains the number of test cases T (1 <= T <= 20 ), then ...
by miracle
Thu May 05, 2005 4:07 pm
Forum: Volume 100 (10000-10099)
Topic: 10093 - An Easy Problem!
Replies: 52
Views: 22929

10093: Why WA?

I've still got WA,can anyone help me?


#include <iostream.h>

int f(char a)
{
if(a>='0' && a<='9')
return a-'0';
if(a>='a' && a<='z')
return a-'a'+36;
if(a>='A' && a<='Z')
return a-'A'+10;
}

int main()
{
char line[250];
int max,tmp,i,j;
unsigned long r;

line[0]='\0';
while(cin.getline ...
by miracle
Thu May 05, 2005 3:12 pm
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 22457

Hi,oulongbin ,did you consider about the call which last 24 hours?
[/quote]no call may last more than 24 hours.
I've changed my code,but still WA

//FileName : 145.cpp

//Author : Wang Bo



#include <stdio.h>

#include <iostream.h>

#include <string.h>



double rate[5][4]={0.02,0.10,0.06,0.02 ...
by miracle
Thu May 05, 2005 2:09 pm
Forum: Volume 1 (100-199)
Topic: 124 - Following Orders
Replies: 49
Views: 12886

Why P.E.? 124

I've got AC(P.E.),I cannot find why ? Anyone can help me?

//FileName : 124.cpp
//Author : Wang Bo

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

char vars[20],vartot;
char graph[20][20];
char res[21];
short indeg[20],jection[26];
short j;

void Produce(short k ...
by miracle
Thu May 05, 2005 11:30 am
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 22457

Hi,my algorithm is the same as you ,and also got WA,let's help each other!
Here is my code:

//FileName : 145.cpp

//Author : Wang Bo



#include <stdio.h>

#include <iostream.h>

#include <string.h>



double rate[5][4]={0.02,0.10,0.06,0.02,

0.05,0.25,0.15,0.05,

0.13,0.53,0.33,0.13,

0.17,0.87 ...
by miracle
Sat Apr 30, 2005 11:22 am
Forum: C++
Topic: Dealing with Big Integer in a real contest
Replies: 2
Views: 2447

Dealing with Big Integer in a real contest

Hi, everybody,I'm in trouble with dealing with Big Integer, the data in some problems in UVA is very very big. Though i can use other's Big Integer library,but what can i do in a real contest? I cannot bring the e-copy with me,anyone can suggest about it
by miracle
Sat Apr 30, 2005 11:13 am
Forum: C++
Topic: How should i use 64-bit data in GCC under Linux?
Replies: 6
Views: 3120

Thanks to mf, i've got it
by miracle
Sat Apr 30, 2005 10:30 am
Forum: C++
Topic: How should i use 64-bit data in GCC under Linux?
Replies: 6
Views: 3120

oh , sorry, i did not express it clearly. i mean that i comiple the same code using G++ with no
error under Win XP
by miracle
Fri Apr 29, 2005 3:17 pm
Forum: C++
Topic: How should i use 64-bit data in GCC under Linux?
Replies: 6
Views: 3120

How should i use 64-bit data in GCC under Linux?

#include <iostream.h>

int main()
{
cout<<sizeof(__int64)<<endl;
}

comiple using G++:
error: `__int64' undeclared (first use this function)

But I can use the same code in Vim for Windows XP with no error.
Why? Who can help me?

Go to advanced search