NC14613. 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).
示例1
输入:
2
输出:
Yes
说明:
A = [0,1] and B = [0,1]. Then A mod-dot B = [0,1]示例2
输入:
997
输出:
No
C++11(clang++ 3.9) 解法, 执行用时: 4ms, 内存消耗: 608K, 提交时间: 2020-02-20 23:47:53
#include<stdio.h> int main() { int n; while(~scanf("%d",&n)) { printf("%s\n",n>2?"No":"Yes"); } return 0; }
Python3(3.9) 解法, 执行用时: 19ms, 内存消耗: 2780K, 提交时间: 2021-01-29 13:08:40
n=int(input()) if(n>2): print('No') else: print('Yes')