Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot. He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 看看有没有(n-2)*180/n等于输入的a就好. [代码] #include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; while (T--){ int a; cin >> a; bool ok = false; //(n-2)*180/n for (int n = 3; ;n++){ int temp = (…
Color the fence 时间限制:1000 ms  |  内存限制:65535 KB 难度:2   描述 Tom has fallen in love with Mary. Now Tom wants to show his love and write a number on the fence opposite to Mary’s house. Tom thinks that the larger the numbers is, the more chance to win Mary…
There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjacent fence posts have the same color. Return the total number of ways you can paint the fence. Note:n and…
题意:给出两点,求经过这两点的正n边形的最小面积 题解:这两点一定是最长的弦,我们设正多边形中点c,找到c到每个点的距离(都相同) 我们知道那个等腰三角形的底与每个角度就使用余弦定理 #include<set> #include<map> #include<queue> #include<stack> #include<cmath> #include<vector> #include<string> #include<…
Fence Repair Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 42979   Accepted: 13999 Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000)…
E. Sign on Fence time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Bizon the Champion has recently finished painting his wood fence. The fence consists of a sequence of n panels of 1 meter w…
http://poj.org/problem?id=3253 Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (1 ≤ Li ≤ 50,000) units. He…
Codeforces Round #256 (Div. 2) C C. Painting Fence time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output Bizon the Champion isn't just attentive, he also is very hardworking. Bizon the Champion d…
E. Sign on Fence   Bizon the Champion has recently finished painting his wood fence. The fence consists of a sequence of n panels of 1 meter width and of arbitrary height. The i-th panel's height is hi meters. The adjacent planks follow without a gap…