The classic Two Glass Balls brain-teaser is often posed as: “Given two identical glass spheres, you would like to determine the lowest floor in a 100-story building from which they will break when dropped. Assume the spheres are undamaged when droppe…
Balls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1196 Accepted: 783 Description The classic Two Glass Balls brain-teaser is often posed as: "Given two identical glass spheres, you would like to determine the lowest floor in a 100-…
优先队列 + 反向拓扑 //#include<bits/stdc++.h> #include<iostream> #include<cstdio> #include<algorithm> #include<queue> #include<cstring> using namespace std; ; int n, m; vector<int>G[maxn]; int inDeg[maxn]; int dp[maxn]; i…
Labeling Balls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10161 Accepted: 2810 Description Windy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 toN in such a way that: No two balls share…
Windy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 to N in such a way that: No two balls share the same label. The labeling satisfies several constrains like "The ball labeled with a is lighter than the on…
Labeling Balls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16100 Accepted: 4726 Description Windy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 to N in such a way that: No two balls share…
http://poj.org/problem?id=3687 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14842 Accepted: 4349 Description Windy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 to N in such a way that: No…
Labeling Balls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9641 Accepted: 2636 Description Windy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 to N in such a way that: No two balls share the…