CF1096C Polygon for the Angle
思路:
要想到正n边形中所有可能的ang为180 * k / n (1 <= k <= n - 2)。
根据n = 180 * k / ang, n是大于等于3的整数,并且n >= k + 2,计算满足条件的最小的n即可。

实现:
#include <bits/stdc++.h>
using namespace std;
int my_ceil(int x, int y)
{
return (x + y - ) / y;
}
int main()
{
int T, a;
cin >> T;
while (T--)
{
cin >> a;
int lb = my_ceil( * a, - a);
lb = max(lb, my_ceil(a, ));
int g = __gcd(, a);
int ans = / g;
a /= g;
if (lb > a) ans *= my_ceil(lb, a);
cout << ans << endl;
}
return ;
}
CF1096C Polygon for the Angle的更多相关文章
- CF-1096C Polygon for the Angle
CF-1096C Polygon for the Angle https://codeforces.com/contest/1096/problem/C 题意:给一个角度ang(1<=ang&l ...
- C. Polygon for the Angle 几何数学
C. Polygon for the Angle 几何数学 题意 给出一个度数 ,问可以实现的最小的n的n边形是多少 思路 由n边形的外角和是180度直接就可以算出最小的角是多少 如果给出的度数是其最 ...
- 【数学】【CF1096C】 Polygon for the Angle
Description 给定一个角度 \(\theta\),请你寻找一个正 \(n\) 边型,满足在这个正 \(n\) 边型上找三个顶点 \(A,B,C\) (可以不相邻),使得 \(\angle A ...
- C. Polygon for the Angle(几何)
题目链接:http://codeforces.com/contest/1096/problem/C 题目大意:T是测试样例,然后每一次输入一个角度,然后问你在一个n边形里面,能不能构成这个角度,如果能 ...
- WPF学习05:2D绘图 使用Transform进行控件变形
在WPF学习04:2D绘图 使用Shape绘基本图形中,我们了解了如何绘制基本的图形. 这一次,我们进一步,研究如何将图形变形. 例子 一个三角形,经Transform形成组合图形: XAML代码: ...
- SVG的Transform使用
SVG的Transform使用: <%@ page language="java" contentType="text/html; charset=UTF-8&qu ...
- Educational Codeforces Round 57 (Rated for Div. 2)
我好菜啊. A - Find Divisible 好像没什么可说的. #include<cstdio> #include<cstring> #include<algori ...
- Educational Codeforces Round 57题解
A.Find Divisible 沙比题 显然l和2*l可以直接满足条件. 代码 #include<iostream> #include<cctype> #include< ...
- Codeforces Educational Round 57
这场出题人好像特别喜欢998244353,每个题里都放一个 A.Find Divisible 考察选手对输入输出的掌握 输出l 2*l即可(为啥你要放这个题,凑字数吗 #include<cstd ...
随机推荐
- docker与虚拟机性能比较(转)
http://blog.csdn.net/cbl709/article/details/43955687 本博客来源于我的个人博客: www.chenbiaolong.com 欢迎访问. 概要 doc ...
- Gym - 101845K 排序+概率
The UNAL programming coaches have lost a bet, they bet the 6 UNAL teams would occupy the first six p ...
- CF1101C Division and Union 线段相交问题
#include<iostream> #include<cstdio> #include<algorithm> #include<cstdlib> #i ...
- Qt 学习之路 2(12):菜单栏、工具栏和状态栏
Home / Qt 学习之路 2 / Qt 学习之路 2(12):菜单栏.工具栏和状态栏 Qt 学习之路 2(12):菜单栏.工具栏和状态栏 豆子 2012年9月10日 Qt 学习之路 2 2 ...
- 查看php 相关信息
PHP系统常量 __FILE__ 当前PHP程序脚本的绝对路径及文件名称 __LINE__ 存储该常量所在的行号 __FUNCTION__ 存储该常量所在的函数名称 __CLASS__ 存储该常量所在 ...
- c#工具类之Int扩展类
public static class IntHelper { /// <summary> /// 转换为2进制字符串 /// </summary> /// <param ...
- MS SqlServer 随机查询并随机排序
MS SqlServer : select top N * from Table1 order by NewId() mySql: SELECT * FROM tableName ORDER BY r ...
- LDAP环境搭建 OpenLDAP和phpLDAPadmin -- yum版
前言: 前两天公司要求做一个使用LDAP和Kerberos做一个认证授权系统,然后开始学习LDAP相关知识,期间找了不少博客按照步骤来安装,可是很多博客在配置的时候,都会遇到安装过程中一两个问题卡 ...
- SQL常用性能统计语句
1.查看SQL语句IO消耗 set statistics io on sql 语句 set statistics io off 2.查看SQL语句时间消耗 set statistics tim ...
- Windows Server2008服务器可以远程桌面,但在内网中却Ping不通--解决方法
Windows Server2008服务器可以通过远程桌面登录,但在内网中却Ping不通.所以要考虑的是防火墙是不是做了限制. 最简单粗暴的方法是直接把防火墙给关掉 还有个其他的方法是参考别人写的,我 ...