Robot Sort All of the refined ingots should be sorted by size in each lot while passing by on a conveyor. Because the conveyor is already running, our robots needs to quickly swap neighboring ingots. You are given the size and initial order of the in…
题目: Probably Dice Battle is full of randomnesses. You should observe randomness in a controlled setting to prepare for this inevitability. We'll start by rolling the dice. Typically, when using multiple dice, you simply roll them and sum up all the r…
计算三角形外接圆的函数: Three Point Circle If we want to build new silos, then we need to make more formal and useful plots of land. Our topographer only marks a few points on the map and thinks that is good enough. It doesn't give us the coordinates which all…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given a table consisting of n rows and m columns. Numbers in each row form a permutation of integers from 1 to m. You are allowed to pic…
Problem: Sort a linked list using insertion sort. The node of the linked list is defined as: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ The insertion sor…