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 ...
Search found 10 matches
- Fri May 13, 2005 4:04 pm
- Forum: Algorithms
- Topic: BeiJing 2004 : Color a Tree
- Replies: 1
- Views: 1548
- 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 ...
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 ...
- 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 ...
#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 ...
- Thu May 05, 2005 3:12 pm
- Forum: Volume 1 (100-199)
- Topic: 145 - Gondwanaland Telecom
- Replies: 62
- Views: 22457
- 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 ...
//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 ...
- Thu May 05, 2005 11:30 am
- Forum: Volume 1 (100-199)
- Topic: 145 - Gondwanaland Telecom
- Replies: 62
- Views: 22457
- 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
- 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
- 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
- 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?
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?