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 ...
随机推荐
- ASP项目部署IIS7.5中遇到的问题
我们大家都熟悉了tomcat服务器的部署,如果是一个ASP项目如何部署呢.这也是我在客户现场遇到的问题.ASP项目一般是用的系统组件IIS来部署项目.下面我讲一下自己在部署过程中遇到的问题. 如果在网 ...
- oracle compile 编译无效对象
原博主:http://blog.csdn.net/tianlesoftware/article/details/4843600 Applies to: Oracle Server - Enterpri ...
- 不同数据源之间的数据同步jdbc解决方案
最近项目中用到的数据要从一个数据源获取存进另一个数据源,简单的jdbc解决方案. package com.sh.ideal.test.syns; import java.sql.Connection; ...
- hadoop sqoop的常用名命令
1 列出所有的ambari数据库中所有的表 Sqoop list-tables -connect jdbc:mysql://localhost:3306/ambari -username ambar ...
- VESA时序与BT1120的区别
在实现内嵌传输的过程中,笔者参考VESA的时序,也就是下图,实现了一个内嵌同步的程序,同步码放在H Back Porch与H Front Porch的后端与前端,但是在传输过程中发现接收端画面不正常. ...
- revoke回收权限的小问题
revoke回收权限的时候,原理是从user/db/tables_priv/columns_priv四个表上delete数据: on *.*的权限在user表上 on xx.*的权限在db表上 on ...
- C语言实现BMP图片生成
## #include <stdio.h> #include <stdlib.h> #include <string.h> typedef unsigned cha ...
- MapGIS10.3新功能
智能的GIS 支持开放的数据集.数据库.等等 T-C-V 软件结构是继局部网软件的 C/S 结构,互联网软件的 B/S 结构发展起来的适合云 计算.云服务的新一代软件三层结构,分别为终端应用层(T 层 ...
- java实现下载excel功能
1,获取服务器现有excel文件 public List<Object[]> getObject(String filePath){ log.info("**文件路径为:**&q ...
- css的三种使用方式:行内样式,内嵌样式,外部引用样式
三中的使用方法的简单实例如下: 行内样式: <!doctype html> <html> <head> <meta charset="UTF-8&q ...