
题目
quarter-moon
这个作者很懒,什么都没留下…
展开
-
String Game
Little Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her, because she is too young. Therefore, her brother Sergey alway...原创 2019-02-07 10:35:30 · 540 阅读 · 0 评论 -
J - 炸弹人
给定一个N × N的2D地图,包含空地'.',障碍'#',敌人'E'和炸弹'B'。 当一枚炸弹爆炸时,冲击会向上下左右4个方向辐射,直到地图边界或者遇到障碍。 E EE..#..BEEBE . E例如上图中的第3行7列的B爆炸时,除了第1列的E没被波及之外,其他E都会被炸到。同时如果冲击波及到另一枚炸弹,会引发连锁反应,即被...原创 2019-02-12 22:18:30 · 385 阅读 · 0 评论 -
错误
Waiting:你的程序刚刚提交,正在等待OJ评测你的程序。 Compiling:OJ正在编译你的程序。 Accepted:OK!你的程序是正确的 ^_^。 Wrong Answer:你的程序运行的结果和正确结果不同。状态页面CASE那一览显示的是你的程序在第几个样例上出错的。 Time Limit Exceeded:你的程序运行时间太长了,超过了对应题目的时...转载 2019-02-13 12:40:38 · 435 阅读 · 0 评论 -
D - Greatest Greatest Common Divisor
Pick two numbers ai,aj(i≠j)ai,aj(i≠j) from a sequence to maximize the value of their greatest common divisor.InputMultiple test cases. In the first line there is an integer TT , indicating the num...原创 2019-02-13 13:05:35 · 189 阅读 · 0 评论 -
最近公共祖先
描述小Ho最近发现了一个神奇的网站!虽然还不够像58同城那样神奇,但这个网站仍然让小Ho乐在其中,但这是为什么呢?“为什么呢?”小Hi如是问道,在他的观察中小Ho已经沉迷这个网站一周之久了,甚至连他心爱的树玩具都弃置一边。“嘿嘿,小Hi,你快过来看!”小Ho招呼道。“你看,在这个对话框里输入我的名字,在另一个对话框里,输入你的名字,再点这个查询按钮,就可以查出来……什么!我们居然有...原创 2019-02-13 14:39:08 · 154 阅读 · 0 评论 -
E - Rabbit hunt
A good hunter kills two rabbits with one shot. Of course, it can be easily done since for any two points we can always draw a line containing the both. But killing three or more rabbits in one shot is...原创 2019-02-14 13:09:32 · 147 阅读 · 0 评论 -
五星填数之类的杂七杂八的
懒得分类了#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int main(){ int a[10]={1,2,3,4,5,6,8,9,10,12}; int s1,s2,s3,s4,s5; int cnt=0; ...原创 2019-03-14 21:20:56 · 260 阅读 · 0 评论 -
洛谷
一天得做洛谷十题,是可完成的,因为大学没什么作业。计划start这题目这么水,我依旧不会,可以见到我弱到没有边了。水平实在太垃圾了,赶紧做。单词接龙题目描述单词接龙是一个与我们经常玩的成语接龙相类似的游戏,现在我们已知一组单词,且给定一个开头的字母,要求出以这个字母开头的最长的“龙”(每个单词都最多在“龙”中出现两次),在两个单词相连时,其重合部分合为一部分,例如beastbea...原创 2019-03-16 21:06:35 · 1655 阅读 · 0 评论 -
3.23
Educational Codeforces Round 62 (Rated for Div. 2)C题#include<bits/stdc++.h>using namespace std;const int maxn=3e5+4;#define ll long long struct node{ ll t,v;}nod[maxn];priority_queue...原创 2019-03-25 17:27:42 · 260 阅读 · 0 评论 -
3.22
hdu1348 (凸包模板题)最小长度代表凸包题意是说一个国王给你一些点,这些点组成一个城堡,国王要求在这个多边形形状的城堡周围建起周长最小的城墙,并且城墙与城堡的距离处处不得小于L。#include<bits/stdc++.h>using namespace std;const int maxn=1006;const double pi=acos(-1.0);str...原创 2019-03-23 14:20:48 · 145 阅读 · 0 评论 -
STL
#include <assert.h>void assert( int expression );#include <stdio.h>#include <assert.h>#include <stdlib.h>int main( void ){ FILE *fp; fp = fopen( ...原创 2019-05-07 08:55:10 · 112 阅读 · 0 评论 -
笔记1
有一部分本人所写,一部分借鉴其他博客,但是忘记备注出处了。侵删POJ2182#include<iostream>#include<cstdio>using namespace std;const int maxn=1e5+5;int s[maxn];int ans[maxn];struct node{ int l,r,n;}...转载 2019-05-27 11:28:14 · 183 阅读 · 0 评论 -
笔记2
有一部分本人所写,一部分借鉴其他博客,侵删。Fibsieve`s Fantabulous BirthdayLightOJ - 1008#include<bits/stdc++.h>using namespace std;#define ll long longll res;ll ress;int main(){ ios::sync_with...转载 2019-05-27 11:29:39 · 211 阅读 · 0 评论 -
POJ3666
POJ3666此题对我意义非凡,毕竟看别人的博客能看晕倒是没谁了。同样是初始化的问题。然后,是个Dp.重点在于怎么确定最优是从原数列中选取的。由于两个或是递增或是递减,可以在中间或者两个端点取得。三个的话,1,5,2,假设如此,最优同样是2和5之间,包括端点,都可以取,然后5到此点的距离和2到此点的距离要加和,保持一定,所以点可以在这个区间里取,然后若是1,5,-1,同样所求的改变的最...原创 2019-05-30 21:07:33 · 151 阅读 · 0 评论 -
666
如果一个数字字符串(只包含0-9,可以有前导0)中出现且只出现1次666,我们就称这个字符串是好的。例如1666、03660666是好的,6666、66、123不是好的。请你计算长度为N的数字字符串中,有多少个是好的。由于总数可能很大,你只需要输出总数模1000000007的余数。Input一个整数N。 对于30%的数据,1 ≤ N ≤ 8 对于100%的数据,1 ≤ ...原创 2019-02-12 18:41:24 · 134 阅读 · 0 评论 -
跳石头
有 n 个石头从左到右拍成一排,第 i 个石头的颜色为 ci 。现在小 Ho 在第一个石头,他想跳到第 n 个石头,每一步有两种跳跃方式:1. 从第 i 个石头跳到第 i+1 个石头2. 跳到右边第一个和当前石头颜色相同的石头(如果存在的话)现在他想知道,从第一个石头跳到第 n 个石头至少需要几步跳跃Input第一行一个正整数 n第二行 n 个正整数,表示ci1 ...原创 2019-02-12 16:58:41 · 419 阅读 · 0 评论 -
B - Diagonal Walking
Mikhail walks on a 2D plane. He can go either up or right. You are given a sequence of Mikhail's moves. He thinks that this sequence is too long and he wants to make it as short as possible.In the g...原创 2019-02-07 10:48:41 · 159 阅读 · 0 评论 -
C - String Typing
You are given a string s consisting of n lowercase Latin letters. You have to type this string using your keyboard.Initially, you have an empty string. Until you type the whole string, you may perfo...原创 2019-02-07 13:29:19 · 283 阅读 · 0 评论 -
D - Matrix Walk
There is a matrix A of size x × y filled with integers. For every , Ai, j = y(i - 1) + j. Obviously, every integer from [1..xy] occurs exactly once in this matrix.You have traversed some path in thi...原创 2019-02-07 15:51:24 · 262 阅读 · 0 评论 -
E - Again Palindrome
A palindorme is a sequence of one or more characters that reads the same from the left as it does from the right. For example, Z, TOT and MADAM are palindromes, but ADAM is not.Given a sequence S of ...原创 2019-02-07 18:20:56 · 152 阅读 · 0 评论 -
F - Diverse Substring
You are given a string ss, consisting of nn lowercase Latin letters.A substring of string ss is a continuous segment of letters from ss. For example, "defor" is a substring of "codeforces" and "fors...原创 2019-02-07 18:56:43 · 261 阅读 · 0 评论 -
G - Vasya and Books
Vasya has got nn books, numbered from 11 to nn , arranged in a stack. The topmost book has number a1a1 , the next one — a2a2 , and so on. The book at the bottom of the stack has number anan . All numb...原创 2019-02-07 20:20:59 · 175 阅读 · 0 评论 -
H - Vasya and Robot
Vasya has got a robot which is situated on an infinite Cartesian plane, initially in the cell (0,0)(0,0) . Robot can perform the following four kinds of operations:U — move from (x,y)(x,y) to (x,y+1...原创 2019-02-07 23:16:46 · 193 阅读 · 0 评论 -
I - Berland Fair
XXI Berland Annual Fair is coming really soon! Traditionally fair consists of nn booths, arranged in a circle. The booths are numbered 11 through nn clockwise with nn being adjacent to 11 . The ii ...原创 2019-02-08 11:48:59 · 165 阅读 · 0 评论 -
R - 数字游戏2
小 Hi 有一个数字 k,小 Hi 可以对他进行多次变换:每次变换选择 k 的一个大于 1 的约数 d,然后将 k 变成 k/d现在小 Hi 想将一个数字变成 1,求操作的方案数。由于方案数可能过大,你只需要输出方案数对 109+7 取模后的值。例如对于k=10,有三种方案:10->5->1,10->1,10->2->1。Input一个正整数 k1...原创 2019-02-08 15:21:36 · 248 阅读 · 0 评论 -
U - 特工配对
在 A 国有一个秘密特工组织,这个特工组织是由若干对双人组合构成的现在特工组织有一批新人加入,为了防止背叛,组织规定来自相同城市的人不能配对在一起现在已知 A 国有 n 个城市,且新人中来自第 i 个城市的有 ai 人,求最多组成几个配对Input第一行一个正整数 n第二行 n 个数,第 i 个数是 ai1 ≤ n ≤ 1030 ≤ ai ≤ 109Output...原创 2019-02-08 18:47:25 · 197 阅读 · 0 评论 -
拼三角形
给定 n 根木棍,第 i 根长度为 ai现在你想用他们拼成尽量多的面积大于 0 的三角形,要求每根木棍只能被用一次,且不能折断请你求出最多能拼出几个Input第一行一个正整数 n第二行 n 个正整数 a1 … an1 ≤ n ≤ 151 ≤ ai ≤ 109Output输出最多能拼出几个三角形Sample Input62 2 3 4 5 6Sam...转载 2019-02-09 22:40:59 · 842 阅读 · 0 评论 -
W - 最短公共子序列
给定一个 01 串 A,你需要找一个和它等长的01串 B,使得 A 和 B 的最长公共子序列最短为了方便,你不需要输出 B,你只需要输出 A 和 B 的最长公共子序列的长度Input第一行一个 01 串 A1 ≤ |A| ≤ 105Output输出最短的长度Sample Input000111Sample Output3#include<bi...原创 2019-02-09 23:02:51 · 1057 阅读 · 0 评论 -
L - 修改字符串
给定两个字符串S和T,每次小Ho可以对S进行以下操作:选定S中的一个字符Si,将Si移动到字符串首位。 例如对于S="ABCD",小Ho可以选择移动B从而得到新的S="BACD";也可以选择移动C得到"CABD";也可以选择移动D得到"DABC"。 请你计算最少需要几次移动操作,可以使S变成T。Input第一行包含一个字符串S。 第二行包含一个字符串T。 对于3...原创 2019-02-12 09:45:55 · 338 阅读 · 0 评论 -
O - XOR
You are given non-negative integers x, k. Please compute how many non-negative y satisfy y + (x xor y) = x + k. Here + is the usual addition and xor means bitwise exclusive-or. If there are infinitely...原创 2019-02-12 10:04:52 · 267 阅读 · 0 评论 -
是题目呀
Today the company has m tasks to complete. The ith task need xi minutes to complete. Meanwhile, this task has a difficulty level yi. The machine whose level below this task’s level yi cannot complete ...原创 2019-08-07 15:54:08 · 238 阅读 · 0 评论