湖南大学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 ...
随机推荐
- mysql \G
mysql 命令区分大小写.ego (\G) Send command to mysql server, display result vertically. go (\g) ...
- 提高效率!15款最好的 Bug 跟踪应用程序
当涉及到开发项目时,其中比较重要的事情是它需要某种形式的错误和问题跟踪工具来发现和解决问题,否则会浪费大量的时间. 此外,你总是要标签应用来标示那些悬而未决的问题,而这种分期执行的项目进度将帮助您 ...
- 微信小程序开发(二)创建小程序
安装完“微信Web开发者工具”后,手机扫描二维码进入页面. 点击“添加项目”,填入之前获得的AppID(无AppID可忽略),输入项目名称“Hello WXapplet”,选定本地文件夹作为项目目录. ...
- java学习笔记记录
Java内存模型: Java虚拟机规范中将Java运行时数据分为六种. 1.程序计数器:是一个数据结构,用于保存当前正常执行的程序的内存地址.Java虚拟机的多线程就是通过线程轮流切换并分配处理器时间 ...
- 在Java中,你真的会日期转换吗
1.什么是SimpleDateFormat 在java doc对SimpleDateFormat的解释如下: SimpleDateFormat is a concrete class for form ...
- [洛谷P1823]音乐会的等待 题解(单调栈)
[洛谷P1823]音乐会的等待 Description N个人正在排队进入一个音乐会.人们等得很无聊,于是他们开始转来转去,想在队伍里寻找自己的熟人.队列中任意两个人A和B,如果他们是相邻或他们之间没 ...
- ACM-ICPC北京赛区2018重现赛 A题
题目链接:http://hihocoder.com/contest/icpcbeijing2018/problem/1 具体思路:dfs,判断矛盾就可以了. AC代码: #include<ios ...
- 一个爬取https和http通用的工具类(JDK自带的URL的用法)
今天在java爬取天猫的时候因为ssl报错,所以从网上找了一个可以爬取https和http通用的工具类.但是有的时候此工具类爬到的数据不全,此处不得不说python爬虫很厉害. package cn. ...
- Delphi 10 seattle 去掉自带的代码连接线
- 19.Remove Nth Node From End of List---双指针
题目链接 题目大意:删除单链表中倒数第n个节点.例子如下: 法一:双指针,fast指针先走n步,然后slow指针与fast一起走,记录slow前一个节点,当fast走到链表结尾,slow所指向的指针就 ...