Codeforces #285 solution report A. B .C
A-Contest
Question.
Just calculate the scores of the two people based on the requirements.
The Code is as follows:
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include
Using namespace std; # define LL _ int64 # define pi acos (-1.0) const int mod = 100000000; const int INF = 0x3f3f3f; const double eqs = 1e-8; int main () {int a, B, c, d, ans1, ans2; scanf ("% d", & a, & B, & c, & d ); ans1 = max (3 * a/10, a-a/250 * c); ans2 = max (3 * B/10, B-B/250 * d ); // printf ("% d \ n", ans1, ans2); if (ans1> ans2) puts ("Misha"); else if (ans1
B-
Misha and Changing Handles
Search for each input and replace it with a matching condition.
The Code is as follows:
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include
Using namespace std; # define LL _ int64 # define pi acos (-1.0) const int mod = 100000000; const int INF = 0x3f3f3f; const double eqs = 1e-8; map
Q; struct node {char s1 [30], s2 [30];} fei [2000]; int main () {int n, I, j, cnt = 0, flag; char st1 [30], st2 [30]; scanf ("% d", & n); for (I = 0; I
C-
Misha and Forest
From the leaf node, delete the node and search for it. Because the difference or sum of a leaf node is another parent node of the leaf node.
The Code is as follows:
# Include
# Include
# Include
# Include
# Include
# Include
# Include
# Include
Using namespace std; # define LL _ int64 # define pi acos (-1.0) const int mod = 100000000; const int INF = 0x3f3f3f; const double eqs = 1e-8; struct node {int d, x;} fei [1 <17]; struct N {int u, v;} edge [1 <17]; queue
Q; int main () {int n, I, j, d, x, cnt = 0, u, v; scanf ("% d", & n ); for (I = 0; I
The remaining two questions need to be updated ..