青岛 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不是太好做.最后交了 ...
随机推荐
- PHP Ajax跨域问题解决办法
在项目开发中,经常会遇到跨域访问资源,上传图片等,那么这些都怎么解决呢,下面简单介绍一下ajax请求时,解决跨域问题. 原文地址:小时刻个人博客 > http://small.aiweimeng ...
- day 35初识数据库
一.数据库概述 1.什么是数据库?先来看看百度怎么说的. 数据库,简而言之可视为电子化的文件柜——存储电子文件的处所,用户可以对文件中的数据运行新增.截取.更新.删除等操作. 所谓“数据库”系 ...
- exynos4412—链接脚本复习
在u-boot下,定义变量, 编译,编译完后 使用arm-linux-nm arm 没有去头的二进制可执行文件 都在BSS段,均为初始化. 打印之后会出算随机值. 目前还处于uboot阶段,如 ...
- 开了几天的phpmyadmin的总结
近来无事,免费体验了一波腾讯云的vps,打了一个phpstudy,全部默认的配置,只不过,没有给他写入文件的权限 开启了日志,看了下,这几天黑客们的活动 首先,有两三个ip来爆破我的phpmyadmi ...
- Linux入门第二天——基本命令入门(下)
一.帮助命令 1.帮助命令:man (是manual手册的缩写,男人无所不能,/笑哭) 更多man用法以及man page的用法,参见:http://www.linuxidc.com/Linux/20 ...
- 20155311 《Java程序设计》实验四 (Android程序设计)实验报告
20155311 <Java程序设计>实验四 (Android程序设计)实验报告 实验内容 基于Android Studio开发简单的Android应用并部署测试; 了解Android.组 ...
- WPF MVVM从入门到精通1:MVVM模式简介
原文:WPF MVVM从入门到精通1:MVVM模式简介 WPF MVVM从入门到精通1:MVVM模式简介 WPF MVVM从入门到精通2:实现一个登录窗口 WPF MVVM从入门到精通3:数据绑定 W ...
- gdb调试带参数程序
一般来说GDB主要调试的是C/C++的程序.要调试C/C++的程序,首先在编译时,我们必须要 把调试信息加到可执行文件中.使用编译 器(cc/gcc/g++)的 -g 参数可以做到这一点.如: > ...
- Windows下安装RaibbitMQ
1.软件准备 1.1 erlang语言包 到http://www.erlang.org/download.html下载,并且运行! 安装目录C:\Program Files (x86)\erl5.10 ...
- 【LOJ10121】与众不同
[LOJ10121]与众不同 题面 LOJ 题解 这题是_\(tham\)给\(ztl\)他们做的,然而这道题™居然还想了蛮久... 首先可以尺取出一个位置\(i\)上一个合法的最远位置\(pre_i ...