ZOJ 2795 Ambiguous permutations(序列的置换)
来源:互联网 发布:2017软件行业寒冬 编辑:程序博客网 时间:2024/06/02 19:28
原题:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1795
//输入的数组 5 1 2 3 4
//对应的下标 1 2 3 4 5
//置换的序列 2 3 4 5 1(意思给就是给 【下标】 排序 啦)
//弄2个数组,一个放原序列,另一个放置换的序列
#include<iostream>using namespace std;int a[100001];int b[100001];int main(){int n,tmp,flag;while(cin>>n && n!=0){flag=1;for(int i=1;i<=n;i++){cin>>tmp;a[i]=tmp;b[tmp]=i;}for(int i=1;i<=n;i++){if(a[i]!=b[i]){flag=0;break;}}if(flag) cout<<"ambiguous"<<endl;else cout<<"not ambiguous"<<endl;}}
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
- Permutations(hdu2369,置换群)
- poj 2369 Permutations(置换)
- POJ 2470 Ambiguous permutations(水~)
- poj 2470 Ambiguous permutations
- poj 2470 Ambiguous permutations
- codechef Ambiguous Permutations 题解
- poj 2470 Ambiguous permutations
- input子系统四之事件处理过程分析
- 进程与线程
- 程序员的进步从阅读自己的老代码开始
- C++模式匹配
- Android 获取apk签名
- ZOJ 2795 Ambiguous permutations(序列的置换)
- 一些数据你得注意!!
- 阿里云部署Docker(3)----指令学习
- 跨进程调用Service(AIDL Service)
- 我在csdn的第一篇博客
- innodb next-key lock解析
- 震荡发生 4要素 俗语
- 安卓天气应用
- 第一章 Makefile概述