Firestone's blog

By Firestone, history, 22 months ago, In English

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]

Full text and comments »

  • Vote: I like it
  • -9
  • Vote: I do not like it

By Firestone, history, 2 years ago, In English

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

Full text and comments »

  • Vote: I like it
  • +15
  • Vote: I do not like it

By Firestone, history, 3 years ago, In English

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

Full text and comments »

  • Vote: I like it
  • +15
  • Vote: I do not like it

By Firestone, history, 3 years ago, In English

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!

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By Firestone, history, 3 years ago, In English

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!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it