青岛 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不是太好做.最后交了 ...
随机推荐
- 学习html的第一天
HTML 第一章: webde 运行环境: 1. 什么是HTML HTML 是用来描述网页的一种语言. HTML 指的是超文本标记语言:HyperText Markup Languge 超文本 就是网 ...
- redis未授权弱口令检测脚本(redis未授权访问漏洞,利用redis写webshell)
以下如有雷同,不胜荣幸 * --- 示例代码!!!!!----*/ #! /usr/bin/env python # _*_ coding:utf-8 _*_ import socket impor ...
- web安全入门笔记
0x01 前言 这正邪两字,原本难分. 正派弟子若是心术不正,便是邪徒. 邪派中人只要一心向善,便是正人君子. 0x01 信息安全的定义 信息安全,意为保护信息及信息系统免受未经授权的进入.使用.披露 ...
- PTA(BasicLevel)-1012 数字分类
一 题目描述 给定一系列正整数,请按要求对数字进行分类,并输出以下 5 个数字: = 能被 5 整除的数字中所有偶数的和: = 将被 5 除后余 1 的数字按给出顺序进行交错求和,即 ...
- 20155212 2016-2017-2 《Java程序设计》第10周学习总结
20155212 2016-2017-2 <Java程序设计>第10周学习总结 教材学习内容总结 密码学基础 ava API支持多种加密算法.如MessageDigest类,可以构建MD5 ...
- XMAPP 的安装与配置
1.XMAPP简介 1.1.XAMPP(Apache+MySQL/MariaDB+PHP+Perl) 开头的X代表X-OS,代表可以在任何常见操作系统下使用,包括Windows.Mac.Linux ...
- 学号 20155311 2016-2017-2 《Java程序设计》第1周学习总结
学号 2016-2017-2 <Java程序设计>第1周学习总结 教材学习内容总结 JAVA三大平台**:Java SE.Java EE .Java ME. Java SE四个组成部分:J ...
- WPF 带水印的密码输入框
原文:WPF 带水印的密码输入框 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/BYH371256/article/details/83652540 ...
- 【BZOJ4553】[HAOI2016&TJOI2016]序列
[BZOJ4553][HAOI2016&TJOI2016]序列 题面 bzoj 洛谷 题解 一定要仔细看题啊qwq... 我们设$mn[i],mx[i]$表示第$i$个位置上最小出现.最大出现 ...
- 【LG4169】[Violet]天使玩偶/SJY摆棋子
[LG4169][Violet]天使玩偶/SJY摆棋子 题面 洛谷 题解 至于\(cdq\)分治的解法,以前写过 \(kdTree\)的解法好像还\(sb\)一些 就是记一下子树的横.纵坐标最值然后求 ...