https://code.google.com/codejam/contest/6224486/dashboard#s=p1 题目不难,教训记终生 题目给了我们两种操作:1 所有人都吃一个,简记为消除操作 2 所有人不吃,把一个人的煎饼分给另一个人或者新来的人,简记为分配 明显,分配操作分给新来的人更有利,并且分配操作应该在消除操作之前 现在就是怎么分配的问题: 之前错误了两次,因为误认为直接对半分效率更高,但是对于 1 9这组数据,明显是分成 1 3 3 3比分成1 4 5 更优 所以,枚举分…
Problem B. Infinite House of Pancakes Problem's Link:   https://code.google.com/codejam/contest/6224486/dashboard#s=p1 Mean: 有无限多个盘子,其中有n个盘子里面放有饼,每分钟你可以选择两种操作中的一种: 1.n个盘子里面的饼同时减少1: 2.选择一个盘子里面的饼,分到其他盘子里面去: 目标是让盘子里的饼在最少的分钟数内吃完,问最少的分钟数. analyse: 可以分析出,先…
Problem It’s opening night at the opera, and your friend is the prima donna (the lead female singer). You will not be in the audience, but you want to make sure she receives a standing ovation – with every audience member standing up and clapping the…
Problem It’s opening night at the opera, and your friend is the prima donna (the lead female singer). You will not be in the audience, but you want to make sure she receives a standing ovation – with every audience member standing up and clapping the…
题目链接: http://codeforces.com/problemset/problem/522/D D. Closest Equals time limit per test3 secondsmemory limit per test256 megabytes 问题描述 You are given sequence a1, a2, ..., an and m queries lj, rj (1 ≤ lj ≤ rj ≤ n). For each query you need to print…
B. Photo to Remember Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/522/problem/B Description One day n friends met at a party, they hadn't seen each other for a long time and so they decided to make a group photo together…
D. Closest Equals Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://www.lydsy.com/JudgeOnline/problem.php?id=3224 Description You are given sequence a1, a2, ..., an and m queries lj, rj (1 ≤ lj ≤ rj ≤ n). For each query you need to print the minimu…
传送门 A. Reposts time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One day Polycarp published a funny picture in a social network making a poll about the color of his handle. Many of his friend…
First One Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 142    Accepted Submission(s): 37 Problem Description soda has an integer array a1,a2,-,an. Let S(i,j) be the sum of ai,ai+1,-,aj. No…
Sample Input 1 10 2 3 4 4 3 2 2 3 4 4   Sample Output Case #1: 9 要求找出一段数字. 将其分成3部分,第①和第②部分成回文字串,第②和第③部分成回文字串 用manacher算出各个点的回文后字串长度,然点枚举和半径(后部分稍不注意就超时  - -!!) #include <cstdio> #include <iostream> #include <algorithm> #define MAXN 100010…
Prob.1 2015 神奇的幻方 模拟就好了.(这不是noip2017的初赛题么.)代码: #include<cstdio> #include<cstring> #include<iostream> using namespace std; int a[55][55]; int n,x,y,cnt; int main(){ scanf("%d",&n); x=1; y=n/2+1; while(cnt<n*n){ a[x][y]=++…
官方解题报告:http://bestcoder.hdu.edu.cn/blog/2015-multi-university-training-contest-6-solutions-by-zju/ 表示很难看....orz 1003题      链接:http://acm.hdu.edu.cn/showproblem.php?pid=5355 Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K…
二,RoundC import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.ArrayList; import java.util.…
https://code.google.com/codejam/contest/3274486/dashboard Problem The kitchen at the Infinite House of Pancakes has just received an order for a stack of K pancakes! The chef currently has N pancakes available, where N ≥ K. Each pancake is a cylinder…
二,RoundC import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.ArrayList; import java.util.…
前言: 自定义view是android自定义控件的核心之一,那么在学习自定义view之前,我们先来了解下自定义view的自定义属性的attr的用法吧 Android attr 是什么 (1)attr 的简单理解就是一个属性约束,约束具体属性字段的属性的数据类型(boolean.string.float-) (2)attr的文件名称不是固定的,只是方便理解和规范,也可以是其他名称,比如arrt.aesa- (3)其实我们经常在使用,比如我们界面的布局文件,从狭隘的方面理解只要用xml形式文件就涉及…
做Android布局是件很享受的事,这得益于他良好的xml方式.使用xml可以快速有效的为软件定义界面.可是有时候我们总感觉官方定义的一些基本组件不够用,自定义组件就不可避免了.那么如何才能做到像官方提供的那些组件一样用xml来定义他的属性呢?现在我们就来讨论一下他的用法.1.添加文件attrs.xml,位于res\values目录下: <?xml version="1.0" encoding="utf-8"?> <resources> &l…
最近在摸索自定义控件,查找到一些自定义属性的一些资料,解决转载记载下来:看了此详解才方便理解! 我们在做项目的时候,由于android自带的属性不能满足需求,android提供了自定义属性的方法,其中的format是做什么用的?以及如何使用它?下面列出一些常用的. 1. reference:参考某一资源ID. (1)属性定义: <declare-styleable name = "名称"> <attr name = "background" for…
自定义属性格式一共有十种: 1. reference:参考某一资源ID. 2. color:颜色值. 3. boolean:布尔值. 4. dimension:尺寸值. 5. float:浮点值. 6. integer:整型值. 7. string:字符串. 8. fraction:百分数. 9. enum:枚举值. 10. flag:位或运算. 1. reference:参考某一资源ID. (1)属性定义: <declare-styleable name = "名称">…
如何使用 declare-styleable 在创建 xml 到 objectName/res/values/ 命名为 attrs.xml 编辑文件内容为(示例)<?xml version="1.0" encoding="utf-8"?><resources>   <declare-styleable name="test1">       <attr name="test" form…
在软件开发过程中,经常见到,就是APP 的标题栏样式几乎都是一样的,只是文字不同而已,两边图标不同.为了减少重复代码,提高效率, 方便大家使用,我们把标题栏通过组合的方式定义成一个控件. 例下图: 点击: 如不设置左边,右边图片: 下面说一下具体实现步骤: 步骤一: 导航栏包括: * 返回按钮 * 标题 * 右侧按钮(功能不确定) 首先是布局文件,如下: </pre><p></p><pre name="code" class="jav…
原文网址:http://www.cnblogs.com/622698abc/p/3348692.html declare-styleable是给自定义控件添加自定义属性用的 1.首先,先写attrs.xml <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="TestAttr"> <attr name=&q…
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:wen=http://schemas.android.com/apk/res/com.iteye.googlers android:orientation="vertical" android:layout_width="fill_parent" android:layout_heig…
1. reference:参考某一资源ID. (1)属性定义: <declare-styleable name = "名称"> <attr name = "background" format = "reference" /> </declare-styleable> (2)属性使用: <ImageView android:layout_width = "42dip"         …
1. reference:参考某一资源ID. (1)属性定义: <declare-styleable name = "名称"> <attr name = "background" format = "reference" /> </declare-styleable> (2)属性使用: <ImageView android:layout_width = "42dip" android:…
转载:http://www.cnblogs.com/bill-joy/archive/2012/04/26/2471831.html android - 自定义(组合)控件 + 自定义控件外观   Android自定义View实现很简单 继承View,重写构造函数.onDraw,(onMeasure)等函数. 如果自定义的View需要有自定义的属性,需要在values下建立attrs.xml.在其中定义你的属性. 在使用到自定义View的xml布局文件中需要加入xmlns:前缀="http://…
622A - Infinite Sequence    20171123 暴力枚举\(n\)在哪个区间即可,时间复杂度为\(O(\sqrt{n})\) #include<stdlib.h> #include<stdio.h> #include<math.h> #include<cstring> #include<iostream> #include<algorithm> using namespace std; long long n…
蓝桥杯第六届省赛题目-加法变乘法(java) 题目: 我们都知道:1+2+3+ ... + 49 = 1225 现在要求你把其中两个不相邻的加号变成乘号,使得结果为2015 比如: 1+2+3+...+10*11+12+...+27*28+29+...+49 = 2015 就是符合要求的答案. 请你寻找另外一个可能的答案,并把位置靠前的那个乘号左边的数字提交(对于示例,就是提交10). 注意:需要你提交的是一个整数,不要填写任何多余的内容. 我的思路:如案例:1+2+3+...+10*11+12…
1. reference:参考某一资源ID. (1)属性定义: <declare-styleable name = "名称"> <attr name = "background" format = "reference" /> </declare-styleable> (2)属性使用: <ImageView android:layout_width = "42dip" android:…
Largest Number Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. Note: The result may be very large, so you need to return a string…