湖南大学ACM程序设计新生杯大赛(同步赛)E - Permutation
题目描述
输入描述:
The only line with the number n (1 <= n <= 1000)
输出描述:
If there are such two permutation of n that their mod-dot product is also a permutation of n, print "Yes" (without the quote). Otherwise print "No" (without the quote).
输入
2
输出
Yes
说明
A = [0,1] and B = [0,1]. Then A mod-dot B = [0,1]
输入
997
输出
No
备注:
1 <= n <= 1000
题解
规律。
写了个暴力,算了$1$到$11$的答案,发现只有$1$和$2$有解,所以猜了一发。。
#include <cstdio>
#include <algorithm>
using namespace std; int main() {
int n;
scanf("%d", &n);
if(n == 1 || n == 2) printf("Yes\n");
else printf("No\n");
return 0;
}
湖南大学ACM程序设计新生杯大赛(同步赛)E - Permutation的更多相关文章
- 湖南大学ACM程序设计新生杯大赛(同步赛)J - Piglet treasure hunt Series 2
题目描述 Once there was a pig, which was very fond of treasure hunting. One day, when it woke up, it fou ...
- 湖南大学ACM程序设计新生杯大赛(同步赛)A - Array
题目描述 Given an array A with length n a[1],a[2],...,a[n] where a[i] (1<=i<=n) is positive integ ...
- 湖南大学ACM程序设计新生杯大赛(同步赛)L - Liao Han
题目描述 Small koala special love LiaoHan (of course is very handsome boys), one day she saw N (N<1e1 ...
- 湖南大学ACM程序设计新生杯大赛(同步赛)B - Build
题目描述 In country A, some roads are to be built to connect the cities.However, due to limited funds, ...
- 湖南大学ACM程序设计新生杯大赛(同步赛)I - Piglet treasure hunt Series 1
题目描述 Once there was a pig, which was very fond of treasure hunting. The treasure hunt is risky, and ...
- 湖南大学ACM程序设计新生杯大赛(同步赛)D - Number
题目描述 We define Shuaishuai-Number as a number which is the sum of a prime square(平方), prime cube(立方), ...
- 湖南大学ACM程序设计新生杯大赛(同步赛)H - Yuanyuan Long and His Ballons
题目描述 Yuanyuan Long is a dragon like this picture? I don’t know, ...
- 湖南大学ACM程序设计新生杯大赛(同步赛)G - The heap of socks
题目描述 BSD is a lazy boy. He doesn't want to wash his socks, but he will have a data structure called ...
- 湖南大学ACM程序设计新生杯大赛(同步赛)C - Do you like Banana ?
题目描述 Two endpoints of two line segments on a plane are given to determine whether the two segments a ...
随机推荐
- OpenCV---ROI(region of interest)和泛洪填充
一:ROI 感兴趣区(Region of Interest,ROIs) 是图像的一部分,它通过在图像上选择或使用诸如设定阈值(thresholding) 或者从其他文件(如矢量> 转换获得等方法 ...
- vue 和react
React 和 Vue 有许多相似之处,它们都有: 使用 Virtual DOM 提供了响应式 (Reactive) 和组件化 (Composable) 的视图组件. 将注意力集中保持在核心库,而将其 ...
- js和jquery中的遍历对象和数组(forEach,map,each)
arr[].forEach(function(value,index,array){ //do something }) 参数:value数组中的当前项,index当前项的索引,array原始数组: ...
- 【BZOJ】3998: [TJOI2015]弦论
[题意]给定长度为n的小写字母字符串S,求第k小子串.n<=5*10^5. 给定T,T=0时不同位置的相同子串算一个,T=1时算多个. [算法]后缀自动机 [题解]对S建立SAM,T=0则每个节 ...
- virtual和abstract的区别和联系
壹. 相同 他们有些相似.有些场景用哪个都行! 1. 修饰父类.让子类重写 virtual和abstract都是用来修饰父类的,通过覆盖父类的定义,让子类重新定义. 2. 都用必须public 如 ...
- Please move or remove them before you can merge
在使用git pull时,经常会遇到报错: Please move or remove them before you can merge 这是因为本地有修改,与云端别人提交的修改冲突,又没有merg ...
- kali2.0安装虚拟机工具
kali2.0无法安装虚拟机工具,显示VMware Tools无法用于该虚拟机,或者安装之后无法进行复制.粘贴等操作. 解决办法: step1: 更换源 root@starnight:~# vim / ...
- UIAutomation Diagram
- MySQL删除数据几种情况以及是否释放磁盘空间【转】
MySQL删除数据几种情况以及是否释放磁盘空间: 1.drop table table_name 立刻释放磁盘空间 ,不管是 Innodb和MyISAM ; 2.truncate table tabl ...
- 004ICMP-type对应表
一次在某个防火墙配置策略里看到如下的代码: iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT iptables -A FORWARD -p icmp ...