04 2020 档案
摘要:Sample Input Sample Output4 8 50 2 10 40 2 2 80 9 13 20 5110Sample Input Sample Output10 2079 809484 180 8347 336421 2509 3732 560423 483 2619 958859
阅读全文
摘要:Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 2920 Accepted: 1483 Description Recently Georgie has learned about polynomials. A polynomia
阅读全文
摘要:Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 49924 Accepted: 12705 Description FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the ann
阅读全文
摘要:1798: [Ahoi2009]Seq 维护序列seq Time Limit: 30 Sec Memory Limit: 64 MBSubmit: 9612 Solved: 3560[Submit][Status][Discuss] Description 老师交给小可可一个维护数列的任务,现在小可
阅读全文
摘要:Examples input Copy 31 21 3 output Copy 0 input Copy 51 22 33 44 5 output Copy 2 Note Tree definition: https://en.wikipedia.org/wiki/Tree_(graph_theor
阅读全文
摘要:You are given n magical numbers a 1, a 2, ..., a n, such that the length of each of these numbers is 20 digits. You can move from the i th number to t
阅读全文
摘要:You are given an array a consisting of n integers. A subarray (l, r) from array a is defined as non-empty sequence of consecutive elements al, al + 1,
阅读全文
摘要:An anagram is a word or phrase formed by rearranging the letters of another word or phrase, using all the original letters exactly once, such as "post
阅读全文
摘要:题意: 一开始所有点都是花园 1为首都(即根) 现在n个点里弄k个工厂,而密探都在工厂点上 密探回首都时每经过一个花园时幸福度+1 密探一定走最短路 问最大幸福度之和 思路:BFS求出每个节点的深度,然后再减掉每个节点儿子所做的贡献,思路在代码中(DFS更简单) 代码: #include <iost
阅读全文
摘要:Output For each test case, print a single line containing the number of unique subarrays OR values among the subarray OR values of all subarrays in th
阅读全文
摘要:题目描述Kayaking is playing a puzzle game containing n different blocks. He marks the blocks with integers from 1 to n, which show the blocks’ original po
阅读全文
摘要:Putting two similar strings together will create a very strong power that can quake the earth into parts and the person who did that can be called the
阅读全文
摘要:小希到了大学,发现宿舍里有很多蟑螂,蟑螂有两种颜色:红色和黑色 他把宿舍里的蟑螂排成一排,一共n只,小希想让他们变成颜色交替。 每次操作可以为:一、将一只蟑螂染成另一种颜色,二、交换两个蟑螂的位置 小希没有带电脑,他请你帮忙计算一下,最少需要操作几次才能形成颜色交替的一排蟑螂 Input 第一行一个
阅读全文
摘要:WNJXYK hates Destinys so that he does not want to meet him at any time. Luckily, their classrooms and dormitories are at different places. The only ch
阅读全文
摘要:You are given a grid consisting of n rows each of which is dived into n columns. The rows are numbered from 1 to n from top to bottom, and the columns
阅读全文
摘要:给你一个n*n的格子的棋盘,每个格子里面有一个非负数。 从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。 Input包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n<=20)Output对于每个测试实例,输出可能取
阅读全文
摘要:Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn
阅读全文
摘要:You are given an array a consists of n elements, find the maximum number of elements you can select from the array such that the absolute difference b
阅读全文
摘要:Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going th
阅读全文
摘要:Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she
阅读全文
摘要:题意:给定长度n的整数数组,以及整数s,求出总和不小于s的子数组长度的最小值。 Input 第一行输入n和s,第二行输入n个正整数。 Output 找到满足要求的子数组的最小长度,如果没有,输出0。 Sample Input 2 10 15 5 1 3 5 10 7 4 9 2 8 5 11 1 2
阅读全文
摘要:bobo has a sequence a 1,a 2,…,a n. He is allowed to swap two adjacent numbers for no more than k times. Find the minimum number of inversions after hi
阅读全文
摘要:In this problem, you are given two permutations a and b of n numbers, and you need to play a game with them! In this game, you are required to perform
阅读全文
摘要:There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say t
阅读全文
摘要:Jungle Roads Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 27279 Accepted: 12839 Description The Head Elder of the tropical island of Lag
阅读全文
摘要:参考博客:https://blog.csdn.net/Shaosenmonitor/article/details/102681095拿 HDU-1233 还是畅通工程 这道题作为例子Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全
阅读全文
摘要:鸡山村发生了一次地震。ACM (Asia Cooperated Medical 亚洲联合医疗队) 已经为圣维尔供电中心的电脑搭建了一个无线网络,但受到了一次不可预知的余震攻击,因此网络中的所有电脑都被破坏了。电脑被逐台修复,网络逐步恢复了工作。由于受到硬件的约束,每台电脑只能与距离它不超过 d 米的
阅读全文
摘要:A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Ea
阅读全文
摘要:Given N numbers, X1, X2, ... , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences
阅读全文
摘要:Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the
阅读全文
摘要:bool check(){ } while(l<=r) { int mid=(l+r)/2;//min=l+(r-l)/2 防止数据溢出 if(check(mid)) l=mid+1; else r=mid-1; } //最大值最小答案是l,最小值最大答案是r
阅读全文
摘要:训练赛上一题,当时没做出来,Orz太弱了 The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c
阅读全文
摘要:It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane has dec
阅读全文
摘要:每年奶牛们都要举办各种特殊版本的跳房子比赛,包括在河里从一块岩石跳到另一块岩石。这项激动人心的活动在一条长长的笔直河道中进行,在起点和距离起点 L 远的终点各有一块岩石 (1 ≤ L ≤ 10^9)。在起点和终点之间,有 N 块岩石 (0 ≤ N ≤ 50000),每块岩石与起点的距离分别为 Di
阅读全文
摘要:Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize
阅读全文
摘要:Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral poste
阅读全文
摘要:以下为为求区间和,求区间最大值,最小值模板 题目以 敌兵布阵 HDU - 1166 为例子 #include <iostream> #include <algorithm> #include <string.h> #include <cstdio> #include <string> #includ
阅读全文
摘要:传送门https://codeforces.com/contest/1167/problem/B 题意 交互题:现在你有6个数4, 8, 15, 16, 23, 42组成的某种组合,你可以询问系统四个问题,每次询问的格式为?i j 然后系统会回复你ai*aj的值,问你这个组合是哪种,题目肯定有解且解
阅读全文