Блог пользователя Firestone

Автор Firestone, история, 23 месяца назад, По-английски

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Don't use for(auto &x: a) for a[N]

Полный текст и комментарии »

  • Проголосовать: нравится
  • -9
  • Проголосовать: не нравится

Автор Firestone, история, 2 года назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +15
  • Проголосовать: не нравится

Автор Firestone, история, 3 года назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +15
  • Проголосовать: не нравится

Автор Firestone, история, 3 года назад, По-английски

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!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор Firestone, история, 3 года назад, По-английски

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!

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится