VJ
文章平均质量分 57
chen_zan_yu
一生所爱
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
D - Identity Card(10)
你有身份证吗?但无论如何您一定有身份证号码。从身份证号码上可以得到每个人的具体个人信息。身份证号码有18位,其中前17位包含特殊的特殊含义: 前6位代表你来自的区域,然后8位代表你的生日。其他4位代表什么?你可以百度一下。 以下是本题中可能用到的地区的代码。 在身份证号码中,可能只有33出现,0000是由其他数字取代。 这是塞缪尔的身份证号码331004198910120036你能告诉我他来...原创 2018-08-21 23:05:12 · 2644 阅读 · 0 评论 -
K - Malek and Summer Semester
StatementsMalek registered n courses for the summer semester. Malek has a success rate m, which means he has to succeed at least in ceil(n × m) courses out of the n courses, in order to consider the...原创 2018-08-30 13:35:48 · 340 阅读 · 0 评论 -
E - The Architect Omar
StatementsArchitect Omar is responsible for furnishing the new apartments after completion of its construction. Omar has a set of living room furniture, a set of kitchen furniture, and a set of bedr...原创 2018-08-30 13:34:17 · 312 阅读 · 0 评论 -
A - A Very Hard Question
StatementsHusam was preparing himself for the Graduate Record Examinations (GRE). Yesterday, he read a very hard question, but he could not find a solution for it, so he did not sleep all the night....原创 2018-08-30 13:32:29 · 511 阅读 · 0 评论 -
B - Bonapity
StatementsA group of junior programmers are attending an advanced programming camp, where they learn very difficult algorithms and programming techniques! Near the center in which the camp is held, ...原创 2018-08-29 23:55:13 · 533 阅读 · 0 评论 -
A - Codeforces Rating
StatementsTourist likes competitive programming and he has his own Codeforces account. He participated in lots of Codeforces Rounds, solved so many problems and became "Legendary Grand Master" (the ...原创 2018-08-29 22:49:10 · 365 阅读 · 0 评论 -
Problem L. 01
https://odzkskevi.qnssl.com/406b40240f0809f4429e3ebc38e55f64?v=1535506365 #include <iostream>#include<stdio.h>#include<string.h>#include<math.h>using namespace std;...原创 2018-08-29 21:17:28 · 209 阅读 · 0 评论 -
A Gene Shuffle Problem
A Gene Shuffle ProblemThe genomes of two related species, like that of cabbage and turnip, may contain similar genes. Their order in the genome may be different due to genome transpositions during e...原创 2018-08-29 20:47:56 · 247 阅读 · 0 评论 -
C - 最大数maxnumber
现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果还未执行过查询操作,则t=0),并将所得结果对一个固定的常数D取模,将所得答案插入到数列的末尾。限制:n是非负整数并且在长整范围内。注意:...原创 2018-08-29 19:58:27 · 791 阅读 · 0 评论 -
F - 岛屿的数量
有N个岛连在一起形成了一个大的岛屿,如果海平面上升超过某些岛的高度时,则这个岛会被淹没。原本的大岛屿则会分为多个小岛屿,如果海平面一直上升,则所有岛都会被淹没在水下。给出N个岛的高度。然后有Q个查询,每个查询给出一个海平面的高度H,问当海平面高度达到H时,海上共有多少个岛屿。例如:岛屿的高度为:{2, 1, 3, 2, 3}, 查询为:{0, 1, 3, 2}。当海面高度为0时,所有的...原创 2018-08-25 09:43:17 · 213 阅读 · 1 评论 -
L - 4个数和为0
给出N个整数,你来判断一下是否能够选出4个数,他们的和为0,可以则输出"Yes",否则输出"No"。Input第1行,1个数N,N为数组的长度(4 <= N <= 1000) 第2 - N + 1行:A[i](-10^9 <= A[i] <= 10^9)Output如果可以选出4个数,使得他们的和为0,则输出"Yes",否则输出"No"。Sample原创 2018-08-25 08:40:38 · 214 阅读 · 0 评论 -
A - Mike and palindrome
Mike has a string s consisting of only lowercase English letters. He wants to change exactly one character from the string so that the resulting one is a palindrome.A palindrome is a string that rea...原创 2018-08-29 11:42:56 · 268 阅读 · 0 评论 -
求long long 指数的模板
H - Eyad and Math GyStatementsEyad was given a simple math problem, but since he is very bad at math he asked you to help him.Given 4 numbers, a, b, c, and d. Your task is to find whether ab is ...原创 2018-08-30 14:52:55 · 236 阅读 · 0 评论 -
H - 数组中和等于K的数对
给出一个整数K和一个无序数组A,A的元素为N个互不相同的整数,找出数组A中所有和等于K的数对。例如K = 8,数组A:{-1,6,5,3,4,2,9,0,8},所有和等于8的数对包括(-1,9),(0,8),(2,6),(3,5)。Input第1行:用空格隔开的2个数,K N,N为A数组的长度。(2 <= N <= 50000,-10^9 <= K <= 10^9)...原创 2018-08-24 21:25:33 · 206 阅读 · 0 评论 -
C - 翻翻棋 FZU - 2230
象棋翻翻棋(暗棋)中双方在4*8的格子中交战,有时候最后会只剩下帅和将。根据暗棋的规则,棋子只能上下左右移动,且相同的级别下,主动移动到地方棋子方将吃掉对方的棋子。将和帅为同一级别。然而胜负在只剩下帅和将的时候已定。Input第一行T,表示T组数据。每组数据共有四行字符串,每行字符串共八个字符’#’表示空格’*’表示红方帅’.’表示黑方将此时红方先走 每组输入之...原创 2018-08-24 20:53:10 · 328 阅读 · 0 评论 -
A - 0和5
小K手中有n张牌,每张牌上有一个一位数的数,这个字数不是0就是5。小K从这些牌在抽出任意张(不能抽0张),排成一行这样就组成了一个数。使得这个数尽可能大,而且可以被90整除。注意:1.这个数没有前导0,2.小K不需要使用所有的牌。 Input每个测试数据输入共2行。 第一行给出一个n,表示n张牌。(1<=n<=1000) 第二行给出n个整数a00,a11,a...原创 2018-08-24 20:26:59 · 235 阅读 · 0 评论 -
B - 数据大搜索
写一个程序,把一个字符串中的数字子序列找出来并转换成十进制整数输出。Input第一行是整数nn,表示测试的数据组数,下面是nn行无空格的字符串(长度不超过200)。题目保证字符串中含的整数位数小于99位,不考虑负数情形。Output每一行输入对应一行输出,一行中若有多个数据,每个数据后有一个空格。Sample Input100tUrA-Hc:T#7yN`;J0123Y+...原创 2018-08-24 19:59:01 · 295 阅读 · 0 评论 -
E - 权势二进制
一个十进制整数被叫做权势二进制,当他的十进制表示的时候只由0或1组成。例如0,1,101,110011都是权势二进制而2,12,900不是。当给定一个n的时候,计算一下最少要多少个权势二进制相加才能得到n。 Input单组测试数据。 第一行给出一个整数n (1<=n<=1,000,000)Output输出答案占一行。Sample Input9Sa...原创 2018-08-24 19:45:02 · 230 阅读 · 0 评论 -
E - Digital Roots(10)
一个数的“魔幻数字”是指它所有位数上的数之和,如果“魔幻数字”仅有一位,则被称为这个数的“究极魔幻数字”,如果“魔幻数字”有两位及两位以上,则需重复寻找“魔幻数字”的步骤,直到找到“究极魔幻数字”。 例如,对于一个正整数128,它的“魔幻数字”为11,但11有两位,所以重复之前的步骤,得到11的“魔幻数字”为2,2仅有一位数,则2是我们需要的“究极魔幻数字”。 Input多组输入数据,每...原创 2018-08-21 19:15:28 · 185 阅读 · 0 评论 -
D - Dice Game
StatementsA dice is a small cube, with each side having a different number of spots on it, ranging from 1 to 6.Each side in the dice has 4 adjacent sides that can be reached by rotating the dice (...原创 2018-08-31 18:06:45 · 705 阅读 · 0 评论 -
Problem C Careful Ascent
https://odzkskevi.qnssl.com/6836414847736f02d53c4f33fa03f900?v=1535447371#include <iostream>#include<stdio.h>#include<algorithm>using namespace std;int main(){ int n,m; ...原创 2018-08-29 00:02:04 · 384 阅读 · 0 评论 -
E - Exam Redistribution
NWERC 2016 Problem E Exam Redistribution Picture from US Navy, public domain Linda is giving an exam. When the exam is over, Linda will redistribute the exams among the students for a peer review, so ...原创 2018-08-28 22:17:05 · 582 阅读 · 0 评论 -
B - 查找最大元素(5)
对于输入的每个字符串,查找其中的最大字母,在该字母后面插入字符串“(max)”。 Input输入数据包括多个测试实例,每个实例由一行长度不超过100的字符串组成,字符串仅由大小写字母构成。 Output对于每个测试实例输出一行字符串,输出的结果是插入字符串“(max)”后的结果,如果存在多个最大的字母,就在每一个最大字母后面都插入"(max)"。 Sample Input...原创 2018-08-21 14:12:49 · 184 阅读 · 0 评论 -
Frogger (18.9.10)
Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists' sun...原创 2018-09-10 23:52:02 · 195 阅读 · 0 评论 -
E - Alarm Clock (尺取法)
题目链接:https://cn.vjudge.net/problem/CodeForces-898D Every evening Vitalya sets n alarm clocks to wake up tomorrow. Every alarm clock rings during exactly one minute and is characterized by one intege...原创 2018-09-30 12:20:48 · 365 阅读 · 0 评论 -
B - Alyona and Numbers
题目链接:https://cn.vjudge.net/problem/CodeForces-682AAfter finishing eating her bun, Alyona came up with two integers n and m. She decided to write down two columns of integers —the first column cont...原创 2018-09-30 10:31:21 · 332 阅读 · 0 评论 -
C - Help Shahhoud (18.9.30)(字符串交换的最小次数)
Shahhoud is participating in the first Div.3 contest on Codeforces, the first problem was:Given two strings A and B of equal length N (N is odd), find the minimum number of steps needed to change A ...原创 2018-10-01 11:45:00 · 1125 阅读 · 0 评论 -
A - Martadella Strikes Again (18.9.30)
StatementsSaeed and Shahhoud were attending a training camp for the ACM ICPC 2018 World Finals.At dinner, they were very happy to see that the meal was martadella slices! A martadella slice can be...原创 2018-09-30 23:45:47 · 467 阅读 · 0 评论 -
F - Random Sort (18.9.30)(全排问题,取模问题)
StatementsSaeed is teaching Algorithms 1 at Damascus University, his last lecture was about sorting algorithms. As homework, he gave the students an array A of length n and asked them to sort it in ...原创 2018-09-30 23:40:37 · 543 阅读 · 0 评论 -
畅通工程续 HDU - 1874
题目链接:https://cn.vjudge.net/problem/HDU-1874 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请...原创 2018-09-20 01:50:56 · 171 阅读 · 0 评论 -
E - Straight Shot
题目链接: https://odzkskevi.qnssl.com/3b068390f8a2f00b5e1927f3e846ed02?v=1536723186 #include <iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>#include...原创 2018-09-19 23:48:35 · 267 阅读 · 0 评论 -
Problem L — limit 1 second Delayed Work
题目链接:https://odzkskevi.qnssl.com/3b068390f8a2f00b5e1927f3e846ed02?v=1536723186#include <iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math...原创 2018-09-19 23:10:17 · 253 阅读 · 0 评论 -
Problem A — limit 1 second Odd Palindrome
题目链接: https://odzkskevi.qnssl.com/3b068390f8a2f00b5e1927f3e846ed02?v=1536723186 #include <iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>using namespa...原创 2018-09-19 22:54:52 · 249 阅读 · 0 评论 -
K - Zigzag(尺取法)
Statements题目链接:https://cn.vjudge.net/contest/254692#problem/KA sequence is called "Zigzag" if no three of its consecutive elements are monotone.More formally, if sequence A of length N is Zigzag...原创 2018-09-19 00:38:22 · 311 阅读 · 0 评论 -
F - 走格子(10)
有编号1-n的n个格子,机器人从1号格子顺序向后走,一直走到n号格子,并需要从n号格子走出去。机器人有一个初始能量,每个格子对应一个整数Aii,表示这个格子的能量值。如果Aii > 0,机器人走到这个格子能够获取Aii个能量,如果Aii < 0,走到这个格子需要消耗相应的能量,如果机器人的能量 < 0,就无法继续前进了。问机器人最少需要有多少初始能量,才能完成整个旅程。 ...原创 2018-08-21 14:10:58 · 256 阅读 · 0 评论 -
Til the Cows Come Home (19.9.10)
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get b...原创 2018-09-10 23:46:12 · 181 阅读 · 0 评论 -
A: Cakey McCakeFace
#include <iostream>#include<stdio.h>#include<map>using namespace std;int main(){ int n,m; scanf("%d%d",&n,&m); int a[2001]; map<int,int>q; q...原创 2018-09-12 23:29:21 · 396 阅读 · 0 评论 -
F: Shattered Cake
#include <iostream>#include<stdio.h>using namespace std;int main(){ int n; int m; scanf("%d%d",&n,&m); int x,y; int sum=0; while(m--) { s...原创 2018-09-12 22:51:41 · 273 阅读 · 0 评论 -
D - 疯狂的企鹅
在鹅厂工作的DJ开始训练起了鹅厂的企鹅们,现在DJ教小企鹅玩一个疯狂的游戏(危险游戏,小朋友请勿模仿)。现在有一排小企鹅,从左到右编号为1....N,每个小企鹅有一个数字,每天早上,如果一个小企鹅发现他右边的小企鹅的数字比他的小,他就会消灭这个小企鹅。问到了第几天才会没有小企鹅可以被消灭,你需要输出天数-1的值注:所有小企鹅的数字是1...N的排列Input每组数据输入格式...原创 2018-09-06 13:17:14 · 272 阅读 · 0 评论 -
A - 单源最大权路径
有一棵由N个结点构成的树,每一条边上都有其对应的权值。现在给定起点,求从该点出发的一条路径(至少有一条边)使得这条路径上的权值之和最大,并输出这个最大值。Input第一行一个正整数T,代表数据组数。每组数据第一行两个正整数n(2<=n<=10^5),s(1<=s<=n),分别表示树结点数目以及给定的起点,点的编号从1至N。接下来M行,每行三个整数x,y,z,(1&l...原创 2018-09-06 13:14:48 · 222 阅读 · 0 评论
分享