ZOJ 2795 Ambiguous permutations 水~
来源:互联网 发布:剑三苍云捏脸数据成女 编辑:程序博客网 时间:2024/06/05 15:00
题目刚开始没看懂,看了别人博客里的解释才知道是咋回事。。。。。汗,还是挺简单的。。。
#include <cstring>#include <iostream>using namespace std;int arr[100002];int main(void) { int n; while (cin >> n && n) { bool flag = true; memset(arr, 0, sizeof(arr)); for (int i = 1; i <= n; i++) { cin >> arr[i]; } for (int j = 1; j <= n; j++) { if (arr[arr[j]] != j) { flag = false; break; } } if (flag) cout << "ambiguous\n"; else cout << "not ambiguous\n"; } return 0;}
阅读全文
0 0
- ZOJ 2795 Ambiguous permutations 水~
- zoj 2795 Ambiguous permutations
- zoj 2795 Ambiguous permutations
- ZOJ 2795 Ambiguous permutations
- ZOJ 2795 Ambiguous permutations
- ZOJ - 2795 Ambiguous permutations
- ZOJ 2795-Ambiguous permutations
- zoj 2795 Ambiguous permutations(水~)
- ZOJ 2795 Ambiguous permutations(序列的置换)
- Ambiguous Permutations
- Ambiguous permutations
- POJ 2470 Ambiguous permutations(水~)
- poj 2470 Ambiguous permutations
- poj 2470 Ambiguous permutations
- codechef Ambiguous Permutations 题解
- poj 2470 Ambiguous permutations
- poj 2470 Ambiguous permutations
- TOJ 2132.Ambiguous permutations
- 基础知识点巩固
- WKWebView 和本地代码交互方式
- 连续子数组的最大和
- Android 利用服务Service创建标题栏通知
- POJ 3370 Halloween treats(抽屉原理)
- ZOJ 2795 Ambiguous permutations 水~
- BAT及各大互联网公司前端笔试面试题--Html,Css篇(加上自我整理总结哟)
- 欢迎使用CSDN-markdown编辑器
- C++Primer Plus(第六版) 第十二章 第二题
- HDU-2389 Rain on your Parade(二分图之Hopcroft-Karp算法)
- Best Cow Line POJ
- 我的服务器开发之路-安装mysql之mariadb并更改数据库路径
- CSS布局 position float
- tarjan(SCC)模板