POJ 2470
#include<iostream>
#include<stdio.h>
#include<vector>
using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
vector<int> coll;
int num;
int a;
int i;
bool * boo;
while()
{
scanf("%d",&num);
if(num == )
break;
boo = new bool[num];
memset(boo,false,sizeof(bool)*num);
for(i = ; i < num; ++ i)
{
scanf("%d",&a);
coll.push_back(a);
}
for(i = ; i < num; ++ i)
{
if(boo[i])
{
continue;
}
else
{
if(coll[coll[i] - ] != i +)
{
cout<<"not ambiguous"<<endl;
break;
}
else
{
boo[coll[i] - ] = true;
//boo[i] = true;
} } }
if(i == num)
{
cout<<"ambiguous"<<endl;
}
delete[] boo;
coll.clear();
}
}
POJ 2470的更多相关文章
- POJ 2470 Ambiguous permutations(简单题 理解题意)
[题目简述]:事实上就是依据题目描写叙述:A permutation of the integers 1 to n is an ordering of these integers. So the n ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
- POJ 2752 Seek the Name, Seek the Fame [kmp]
Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17898 Ac ...
随机推荐
- (2)The secrets of learning a new language
https://www.ted.com/talks/lydia_machova_the_secrets_of_learning_a_new_language/transcript 00:13I lov ...
- 一个WCF 数据序列化问题
public class EMMPBaseMsg { public String Data { get; set; } public DateTime AddTime { get; set; } pu ...
- Github上下载某一个文件夹
1.安装svn sudo apt-get install subversion 2.修改下载文件夹的链接 例如,https://github.com/a***b/learn/tree/master/m ...
- dj 中间件
中间件的概念 中间件顾名思义,是介于request与response处理之间的一道处理过程,相对比较轻量级,并且在全局上改变django的输入与输出.因为改变的是全局,所以需要谨慎实用,用不好会影响到 ...
- visual studio的试用版评估期已结束 解决办法
启动visual studio 2008后显示对话框:visual studio的试用版评估期已结束.下面有两个按钮,点第一个链接到微软网页,第二个直接关闭.虽然大多数高手已经知道如何解决,但对菜鸟来 ...
- 1105 Spiral Matrix
This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasi ...
- mysql查询 根据年月日的查询
select * from call_loan_info where DATE_FORMAT(create_time,'%Y-%m-%d') = '2017-06-16'
- 《如何阅读it技术书》课堂笔记——51cto
对一些书的看法: “21天精通JAVA之类”的书,好好理解精通二字,哪里有这么快就能学的会. 吐槽新人: Oop理论,别写出来的都是面向过程式. 桌面乱七八糟. 对新人分享一些经验: 阅读时自我提神的 ...
- jQuery插件初级练习2答案
html: $.font($("p"),"30px").html("变化了") jQuery: $.extend({ font:functi ...
- CI、CD和dev-ops概念
传统的开发方式是:需求方提供文档,实现方按照文档一步步开发,中间很少变动和修改. 但是随着市场的变化,产品更新迭代的加快,也要求开放方更快的响应变化,用最短的时间开发,部署上线. 这样,持续集成(CI ...