青岛 2016ICPC 区域现场赛题目
- 1000ms
- 262144K
The Pocket Cube, also known as the Mini Cube or the Ice Cube, is the 2×2×22 \times 2 \times 22×2×2 equivalence of a Rubik’s Cube. The cube consists of 888 pieces, all corners.
Each piece is labeled by a three dimensional coordinate (h,k,l)(h, k, l)(h,k,l) where hhh, kkk, l∈0,1l \in {0, 1}l∈0,1. Each of the six faces owns four small faces filled with a positive integer.
For each step, you can choose a certain face and turn the face ninety degrees clockwise or counterclockwise.
You should judge that if one can restore the pocket cube in one step. We say a pocket cube has been restored if each face owns four same integers.
Input
The first line of input contains one integer N(N≤30)N(N \le 30)N(N≤30) which is the number of test cases.
For each test case, the first line describes the top face of the pocket cube, which is the common 2×22 \times 22×2 face of pieceslabelled by (0,0,1)(0, 0, 1)(0,0,1), (0,1,1)(0, 1, 1)(0,1,1), (1,0,1)(1, 0, 1)(1,0,1), (1,1,1)(1, 1, 1)(1,1,1). Four integers are given corresponding to the above pieces.
The second line describes the front face, the common face of (1,0,1)(1,0,1)(1,0,1), (1,1,1)(1,1,1)(1,1,1), (1,0,0)(1,0,0)(1,0,0), (1,1,0)(1,1,0)(1,1,0). Four integers aregiven corresponding to the above pieces.
The third line describes the bottom face, the common face of (1,0,0)(1, 0, 0)(1,0,0), (1,1,0)(1, 1, 0)(1,1,0), (0,0,0)(0, 0, 0)(0,0,0), (0,1,0)(0, 1, 0)(0,1,0). Four integers are given corresponding to the above pieces.
The fourth line describes the back face, the common face of (0,0,0)(0,0,0)(0,0,0), (0,1,0)(0,1,0)(0,1,0), (0,0,1)(0,0,1)(0,0,1), (0,1,1)(0,1,1)(0,1,1). Four integers are given corresponding to the above pieces.
The fifth line describes the left face, the common face of (0,0,0)(0, 0, 0)(0,0,0), (0,0,1)(0, 0, 1)(0,0,1), (1,0,0)(1, 0, 0)(1,0,0), (1,0,1)(1, 0, 1)(1,0,1). Four integers are given corresponding to the above pieces.
The six line describes the right face, the common face of (0,1,1)(0, 1, 1)(0,1,1), (0,1,0)(0, 1, 0)(0,1,0), (1,1,1)(1, 1, 1)(1,1,1), (1,1,0)(1, 1, 0)(1,1,0). Four integers are given corresponding to the above pieces.
In other words, each test case contains 242424 integers aaa, bbb, ccc to xxx. You can flat the surface to get the surface development as follows.

Output
For each test case, output YES if can be restored in one step, otherwise output NO.
样例输入
4
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
5 5 5 5
6 6 6 6
6 6 6 6
1 1 1 1
2 2 2 2
3 3 3 3
5 5 5 5
4 4 4 4
1 4 1 4
2 1 2 1
3 2 3 2
4 3 4 3
5 5 5 5
6 6 6 6
1 3 1 3
2 4 2 4
3 1 3 1
4 2 4 2
5 5 5 5
6 6 6 6
样例输出
YES
YES
YES
NO
#include<bits/stdc++.h>
using namespace std;
int a[][];
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
for(int i=; i<=; i++)
{
for(int j=; j<=; j++)
{
scanf("%d",&a[i][j]);
}
}
int summ=;
int sum=;
for(int i=; i<=; i++)
{
if(a[i][]==a[i][] && a[i][]==a[i][] && a[i][]==a[i][])
{
summ++;
}
}
if((a[][]==a[][] && a[][]==a[][] && a[][]==a[][]) && (a[][]==a[][] && a[][]==a[][] && a[][]==a[][]))
{
sum=;
}
if((a[][]==a[][] && a[][]==a[][] && a[][]==a[][]) && (a[][]==a[][] && a[][]==a[][] && a[][]==a[][]))
{
sum=;
}
if((a[][]==a[][] && a[][]==a[][] && a[][]==a[][]) && (a[][]==a[][] && a[][]==a[][] && a[][]==a[][]))
{
sum=;
}
if(summ==)
{
printf("YES\n");
}
else if(sum==)
{
printf("NO\n");
}
else if(sum==)
{
if(a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][])
printf("YES\n");
else if(a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][])
printf("YES\n");
else
printf("NO\n");
}
else if(sum==)
{
if(a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][])
printf("YES\n");
else if(a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][])
printf("YES\n");
else
printf("NO\n"); }
else if(sum==)
{
if(a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][])
printf("YES\n");
else if(a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][]&&
a[][]==a[][] &&a[][]==a[][] &&a[][]==a[][])
printf("YES\n");
else
printf("NO\n");
}
else
{
printf("NO\n");
}
}
return ;
}
- 1000ms
- 262144K
Let’s talking about something of eating a pocky. Here is a Decorer Pocky, with colorful decorative stripes in the coating, of length LLL.
While the length of remaining pocky is longer than ddd, we perform the following procedure. We break the pocky at any point on it in an equal possibility and this will divide the remaining pocky into two parts. Take the left part and eat it. When it is not longer than ddd, we do not repeat this procedure.
Now we want to know the expected number of times we should repeat the procedure above. Round it to 666 decimal places behind the decimal point.
Input
The first line of input contains an integer NNN which is the number of test cases. Each of the NNN lines contains two float-numbers LLL and ddd respectively with at most 555 decimal places behind the decimal point where 1≤d,L≤1501 \le d, L \le 1501≤d,L≤150.
Output
For each test case, output the expected number of times rounded to 666 decimal places behind the decimal point in a line.
样例输入
6
1.0 1.0
2.0 1.0
4.0 1.0
8.0 1.0
16.0 1.0
7.00 3.00
样例输出
0.000000
1.693147
2.386294
3.079442
3.772589
1.847298 思路:微分。
代码:
#include<bits/stdc++.h>
using namespace std;
int n;
double l,d;
int main()
{
scanf("%d",&n);
while(n--)
{
scanf("%lf%lf",&l,&d);
if(l<=d)
{
printf("0.000000\n");
}
else
{
printf("%.6f\n",+log(l/d));
}
}
return ;
}
青岛 2016ICPC 区域现场赛题目的更多相关文章
- HDU 5920 Ugly Problem 高精度减法大模拟 ---2016CCPC长春区域现场赛
题目链接 题意:给定一个很大的数,把他们分为数个回文数的和,分的个数不超过50个,输出个数并输出每个数,special judge. 题解:现场赛的时候很快想出来了思路,把这个数从中间分为两部分,当位 ...
- HDU 4802 && HDU 4803 贪心,高精 && HDU 4804 轮廓线dp && HDU 4805 计算几何 && HDU 4811 (13南京区域赛现场赛 题目重演A,B,C,D,J)
A.GPA(HDU4802): 给你一些字符串对应的权重,求加权平均,如果是N,P不计入统计 GPA Time Limit: 2000/1000 MS (Java/Others) Memory ...
- HDU 4811 Ball -2013 ICPC南京区域现场赛
题目链接 题意:三种颜色的球,现给定三种球的数目,每次取其中一个放到桌子上,排成一条线,每次放的位置任意,问得到的最大得分. 把一个球放在末尾得到的分数是它以前球的颜色种数 把一个球放在中间得到的分数 ...
- 2013ACM/ICPC亚洲区南京站现场赛——题目重现
GPA http://acm.hdu.edu.cn/showproblem.php?pid=4802 签到题,输入两个表,注意细心点就行了. #include<cstdio> #inclu ...
- 2013ACM/ICPC亚洲区南京站现场赛---Poor Warehouse Keeper(贪心)
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=4803 Problem Description Jenny is a warehouse keeper. ...
- 2016 ACM/ICPC亚洲区青岛站现场赛(部分题解)
摘要 本文主要列举并求解了2016 ACM/ICPC亚洲区青岛站现场赛的部分真题,着重介绍了各个题目的解题思路,结合详细的AC代码,意在熟悉青岛赛区的出题策略,以备战2018青岛站现场赛. HDU 5 ...
- 2014ACM/ICPC亚洲区域赛牡丹江现场赛总结
不知道怎样说起-- 感觉还没那个比赛的感觉呢?如今就结束了. 9号.10号的时候学校还评比国奖.励志奖啥的,由于要来比赛,所以那些事情队友的国奖不能答辩.自己的励志奖班里乱搞要投票,自己又不在,真是无 ...
- 2014ACMICPC亚洲区域赛牡丹江现场赛之旅
下午就要坐卧铺赶回北京了.闲来无事.写个总结,给以后的自己看. 因为孔神要保研面试,所以仅仅有我们队里三个人上路. 我们是周五坐的十二点出发的卧铺,一路上不算无聊.恰巧邻床是北航的神犇.于是下午和北航 ...
- 2018ICPC青岛现场赛 重现训练
先贴代码,以及简要题解. 和一个队友下午双排打了一下,队友光速签到,我签的J被嫌弃写得慢以及演员...然后我秒出了E了思路然而难以置信这么简单的思路当时才过了十几个,于是发现D.F不是太好做.最后交了 ...
随机推荐
- 使用Hexo + GitHub Pages 搭建个人博客
一.前言 之前是在CSDN上写博客的,但是无奈其广告满天飞,还有因为个人不太喜欢CSDN博客里的一些东西,加上看到很多技术大牛都有自己的个人博客,于是乎!便想着搭建一个自己的个人博客.其实之前写博客还 ...
- 【python安装】Windows上安装和创建python开发环境
1. 在 windows10 上安装python开发环境 Linux和Mac OS都自带python环境,但是Windows没有,所以需要自行安装. 第1步:访问 python官网,下载Windows ...
- Linux命令—tar
day 7:tar压缩.解压缩.打包.解包命令 区分打包和压缩:打包是指将一大堆文件或目录变成一个总的文件:压缩则是将一个大的文件通过一些压缩算法变成一个小文件. 为什么要区分这两个概念呢?这源于Li ...
- 学习python的一些脚本
python生产者与消费者模型 # -*- coding:utf-8 -*- import threading import random import time gMoney = 1000 gLoc ...
- Java ThreadLocal 源代码分析
Java ThreadLocal 之前在写SSM项目的时候使用过一个叫PageHelper的插件 可以自动完成分页而不用手动写SQL limit 用起来大概是这样的 最开始的时候觉得很困惑,因为直接使 ...
- 旁听<基因编辑与精准医疗>(北京大学)
昨天去北大生命科学院听了一场魏文胜教授关于基因方面的讲座.会场人不算太多,比起上次听城市规划,场面略显冷清.也能从一个侧面反映,关注基础科学领域的人虽然有,但是不是很多. 开场魏教授用了宣传海报作为导 ...
- C++基本概念复习
照着https://www.w3cschool.cn/cpp/,把C++的基础概念顺了一遍,虽然很久没用C++,还是整理一下. #include "stdafx.h"; #incl ...
- Mysql:存储过程游标不进循环的原因详解
------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 本篇博客给刚接触存储过程的朋友做个引导作用,目的是解决游标不走循环 很多人发现他的游标,无论是嵌套循环还是单层 ...
- 15、Java并发编程:Callable、Future和FutureTask
Java并发编程:Callable.Future和FutureTask 在前面的文章中我们讲述了创建线程的2种方式,一种是直接继承Thread,另外一种就是实现Runnable接口. 这2种方式都有一 ...
- 一个自己实现的string
最近实现了一个string类,添加了一些c++11元素. 除了基本的构造析构函数,拷贝构造和赋值函数,另外添加移动拷贝和赋值函数.default是一个很方便的特性有木有. //default cons ...