湖南大学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 ...
随机推荐
- 线上Redis偶发性链接失败排查记
问题过程 输入法业务于12月12日上线了词库接受业务,对部分用户根据用户uuid判断进行回传,在12月17日早上8点多开始出现大量的php报错(Redis went away),报错导致了大量的链接积 ...
- ASP.NET Core的身份认证框架IdentityServer4--IdentityServer相关文章【记录】
Identity Server 4 预备知识 -- OpenID Connect 简介: 原文地址
- Oracle恢复误删除表操作语句
一.表和数据恢复 1.从回收站里查询被删除的表 select object_name,original_name,partition_name,type,ts_name,createtime,drop ...
- extjs 省市县级联
Ext.define('State', { extend: 'Ext.data.Model', fields: [ {type: 'string', name: 'nevalue'}, {type: ...
- NOIP模拟6
期望得分:100+100+100=300 实际得分:0+100+90=190 T1 superman 二分给每条边加多少,判断是否存在负环 #include<queue> #include ...
- HDU 6206 青岛网络赛1001 高精度 简单几何
给出的数据1e12规模,常规判点是否在圆范围内肯定要用到半径,求得过程中无法避免溢出,因此用JAVA自带的浮点大数运算,和个ZZ一样比赛中eclipse出现问题,而且太久没写JAVA语法都不清楚变量忘 ...
- [Luogu 2024] 食物链
[Luogu 2024] 食物链 几句随感 我依稀记得联赛前本来想做这题的时候. 当年啊弱到题目与标签就令我望而生畏. 还有翻阅很多遍那现在已经被遗弃的博客. 看到题解中「三倍数组」的字眼就怕难而放弃 ...
- c# windows server安装启动与卸载
使用installutil.exe安装卸载服务时,由于需要指向服务的全路径,由于生成目录往往不是服务发布的最终目录,很不便利,下面介绍两种方式方便操作: 方式一: 项目中加入install.bat与u ...
- 无废话JavaScript(下)
五.函数式 这个可不是JavaScript的发明,它的发明人已经死了,而他的这个发明还在困扰着我们……如同爱迪生的灯泡还在照耀着我们. 其实函数式语言很简单,它就是一种与命令式语言同样“完备”的语言实 ...
- Spark 基本架构及原理
转载自: http://blog.csdn.net/swing2008/article/details/60869183 转自:http://www.cnblogs.com/tgzhu/p/58183 ...