493.md (2205B)
1 Source: https://codeforces.com/blog/entry/14985 2 3 [493A - Vasya and Football](/contest/493/problem/A "Codeforces Round 281 (Div. 2)") 4 5 We need 2 arrays — for the first and second team, in which we must save "status" of the player — is he "clear", yellow carded or sent off. Then while inputing we must output the players name if he wasn't sent off, and after the event he must be sent off. 6 7 [493B - Vasya and Wrestling](/contest/493/problem/B "Codeforces Round 281 (Div. 2)") 8 9 We need to vectors in which we will save points of first and second wrestlers, and two int-s, where we will save who made the last technique and what is the sum of all the numbers in the input. If the sum is not zero, we know the answer. Else we pass by the vectors, checking are there respective elements which are not equal. If yes — then we know the answer, else everything depends on who made the last technique. 10 11 [493C - Vasya and Basketball](/contest/493/problem/C "Codeforces Round 281 (Div. 2)") 12 13 We need an array of pairs — in each pair we save the distance and the number of team. Then we sort the array. Then we assume that all the throws bring 3 points. Then we pass by the array and one of our numbers we decrease on 1 (which one — it depends on the second element of array). Then we compare it with our answer. In the end — we print our answer. 14 15 [493D - Vasya and Chess](/contest/493/problem/D "Codeforces Round 281 (Div. 2)") 16 17 If n is odd, then black can win white doing all the moves symetric by the central line. Else white can win putting his queen on (1,2) (which is the lexicographicly smallest place) and play symetricly — never using the first row. 18 19 [493E - Vasya and Polynomial](/contest/493/problem/E "Codeforces Round 281 (Div. 2)") 20 21 Let's discuss 2 case. 1) t!=1 и 2) t=1. 22 23 1) If our function is not constant (n>=1) than a is greater all the coefficients, so the only polynom can be the number b — in the a-ary counting system. We must only check that one and constant function. 24 25 2)if t=1 must be careful: 26 27 in case 1 1 1: the answer is inf, 28 29 in case 1 1 n: the answer is 0 30 31 in case 1 а а^x(x-integer, x>0): the answer is 1 32 33 in the other cases P(1) is greater than other coefficients.