It's just a joke, don't take it seriously.

# | User | Rating |
---|---|---|

1 | tourist | 3817 |

2 | jiangly | 3628 |

3 | Benq | 3584 |

4 | slime | 3498 |

5 | maroonrk | 3486 |

5 | djq_cpp | 3486 |

7 | Radewoosh | 3438 |

8 | cnnfls_csy | 3427 |

9 | zh0ukangyang | 3423 |

10 | orzdevinwang | 3399 |

# | User | Contrib. |
---|---|---|

1 | -is-this-fft- | 183 |

2 | awoo | 178 |

3 | dario2994 | 168 |

4 | SecondThread | 167 |

5 | Um_nik | 165 |

6 | maroonrk | 164 |

7 | adamant | 162 |

7 | kostka | 162 |

9 | antontrygubO_o | 158 |

10 | errorgorn | 155 |

It's just a joke, don't take it seriously.

Given $$$n$$$ triangles on the same grid ( more than $$$1$$$ ). Calculate the total area these triangle cover (they may be overlap or not).

Can you help me to approach this problem? Thanks a lot.

Input:

The first line represents number $$$n$$$ ( $$$2$$$ ≤ $$$n$$$ ≤ $$$100$$$ ).

$$$n$$$ lines follow, each line represent 6 integers — the vertices of the triangle $$$i$$$ ($$$-10^{6}$$$ ≤ $$$x$$$, $$$y$$$ ≤ $$$10^{6}$$$ ).

Output: The area which $$$n$$$ triangles cover on. The difference between your output and the answer must be smaller than $$$10^{-6}$$$ .

Sample input:

3

1 1 5 1 3 3

1 2 5 2 5 6

1 6 5 2 1 2

Sample Output:

15.000000

Given a graph with n vertices (2 <= n <= 200). Find the largest set of vertices that each two vertices are connected.

Time: 1s, memory: 256MB

Input: First line contains two numbers n and k — the vertices and the edges.

Next k lines contains the k edges.

Output: The first line contain one number — The size of the set

The second line represents the vertices in the set. If there are more than one set that have the maximum size, print the set that is lexicographically smallest.

Example:

Input:

5 3

1 3

1 4

2 5

Output:

2

1 4

How can I solve this problem? Can you help me with this? Thank you!

Given an array and an integer k. There are two players A and B, each turn one player take one number from the array, after taking all numbers from the array, calculate the sum of the numbers each player has taken. If only A's sum or B's sum is divisible by k, he'll win otherwise it is supposed to be a draw.

A always play first, write a program to predict who will win, or it will be a draw.

Each player plays this game optimally.

Input:

First line contains and integer n — the size of the array and k ( 1 <= N <= 2000, 2 <= k <= 50).

Second line contains the integers in the array (0 <= A[i] <= 1e10).

Output: "A" or "B", depends on who will win or "DRAW" — if there will be no winners.

Sample Input 1:

3 4

4 2 4

Sample Output 1:

B

Sample Input 2:

3 4

2 2 2

Sample Output 2:

A

Sample Input 3:

3 4

8 4 4

Sample Output 3:

DRAW

Can anybody help me with this problem? Thank you so much!

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/10/2022 04:10:14 (k2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|