- 博客(36)
- 收藏
- 关注
原创 2021 ICPC Asia Taiwan Online Programming Contest
2021 ICPC Asia Taiwan Online Programming Contest
2022-09-04 09:41:24
548
1
原创 Deletions of Two Adjacent Letters
The string sss is given, the string length is odd number. The string consists of lowercase letters of the Latin alphabet.As long as the string length is greater than 111, the following operation can be performed on it: select any two adjacent letters in
2022-03-12 16:34:12
482
原创 Way Too Long Words
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be repl
2022-03-12 16:25:26
166
原创 Dijkstra?
题目描述You are given a weighted undirected graph. The vertices are enumerated from 1 to n . Your task is to find the shortest path between the vertex 1 and the vertex n .输入格式The first line contains two integers n n n and m m m ( 2<=n<=10^5,0<=m
2022-02-19 11:00:12
389
原创 Almost Acyclic Graph
You are given a directed graph consisting of n vertices and m edges (each edge is directed, so it can be traversed in only one direction). You are allowed to remove at most one edge from it.Can you make this graph acyclic by removing at most one edge fro
2022-02-19 10:52:36
368
原创 106 miles to Chicago
In the movie "Blues Brothers", the orphanage where Elwood and Jack were raised may be sold to the Board of Education if they do not pay 5000 dollars in taxes at the Cook Country Assessor's Office in Chicago. After playing a gig in the Palace Hotel ballroom
2022-02-19 10:46:02
154
原创 Networking
You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of points. For each possible route between two points, you a
2022-02-19 10:40:57
110
原创 pSort
One day n cells of some array decided to play the following game. Initially each cell contains a number which is equal to it's ordinal number (starting from 1 ). Also each cell determined it's favourite number. On it's move i -th cell can exchange it's val
2022-02-17 17:36:31
336
原创 The Chil and Sequence
At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important things were lost, in particular the favorite sequence of Picks.Fortunately, Picks remembers how to repair the sequence. Initially
2022-02-13 17:49:03
542
原创 Circular RMQ
You are given circular array a0, a1, ..., an - 1. There are two types of operations with it:inc(lf, rg, v) — this operation increases each element on the segment [lf, rg] (inclusively) by v; rmq(lf, rg) — this operation returns minimal value on the segm
2022-02-13 17:45:00
554
原创 维护序列
老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成。有长为 nnn 的数列,不妨设为 a1,a2,⋯ ,an。有如下三种操作形式:把数列中的一段数全部乘一个值; 把数列中的一段数全部加一个值; 询问数列中的一段数的和,由于答案可能很大,你只需输出这个数模 PPP 的值。输入格式第一行两个整数 n 和 P;第二行含有 n 个非负整数,从左到右依次为 a1,a2,⋯ ,an;第三行有一个整数 M,表示操作总数;从第四行开始每行描述一个操作,输入的操作有以下三种形式:
2022-02-13 17:38:05
220
原创 Can you answer these queries V
You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| <= 10000 , 1 <= N <= 10000 ). A query is defined as follows: Query(x1,y1,x2,y2) = Max { A[i]+A[i+1]+...+A[j] ; x1 <= i <= y1 , x2 <= j <= y2 and x1 <= x2 , y1 <= y2 }. Giv
2022-02-12 21:35:05
341
原创 Monsters And Spells
Monocarp is playing a computer game once again. He is a wizard apprentice, who only knows a single spell. Luckily, this spell can damage the monsters.The level he's currently on contains nnn monsters. The i-th of them appears ki seconds after the start
2022-02-12 21:15:22
341
原创 Saving the City
Bertown is a city with n buildings in a straight line.The city's security service discovered that some buildings were mined. A map was compiled, which is a string of length n, where the i-th character is "1" if there is a mine under the building number i
2022-02-12 21:01:44
168
原创 Delete Two Elements
Monocarp has got an array aaa consisting of n integers. Let's denote k as the mathematic mean of these elements (note that it's possible that k is not an integer).The mathematic mean of an array of n elements is the sum of elements divided by the number
2022-02-12 20:30:01
698
原创 QAQ 贪心与动态规划
"QAQ" is a word to denote an expression of crying. Imagine "Q" as eyes with tears and "A" as a mouth.Now Diamond has given Bort a string consisting of only uppercase English letters of length n. There is a great number of "QAQ" in the string (Diamond is
2022-02-12 19:52:10
129
原创 Dropping water balloons
It’s frosh week, and this year your friends have decided that they would initiate the new computer science students by dropping water balloons on them. They’ve filled up a large crate of identical water balloons, ready for the event. But as fate would have
2022-02-09 17:00:54
206
原创 Jin Ge Jin Qu hao
(If you smiled when you see the title, this problem is for you ^_^)For those who don’t know KTV, see: http://en.wikipedia.org/wiki/Karaoke_boxThere is one very popular song called Jin Ge Jin Qu(). It is a mix of 37 songs, and is extremelylong (11 mi
2022-02-09 15:41:11
413
原创 Watering Grass
n sprinklers are installed in a horizontal strip of grass l meters long and w meters wide. Each sprinkler is installed at the horizontal center line of the strip. For each sprinkler we are given its position as the distance from the left end of the center
2022-02-08 10:35:51
959
原创 Smallest Sub-Array
Consider an integer sequence consisting of N elements whereX1 = 1X2 = 2X3 = 3Xi = (Xi−1 + Xi−2 + Xi−3)%M + 1 for i = 4 to NFind 2 values a and b so that the sequence (Xa Xa+1 Xa+2 . . . Xb−1Xb) contains all the integers from [1, K]. If there a...
2022-02-07 18:17:12
758
原创 Can you answer these queries III
You are given a sequence A of N (N <= 50000) integers between -10000 and 10000. On this sequence you have to apply M (M <= 50000) operations:modify the i-th element in the sequence or for given x y print max{Ai + Ai+1 + .. + Aj | x<=i<=j<=y
2022-01-27 11:26:17
584
原创 Can you answer these queries I
You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000 ). A query is defined as follows:Query(x,y) = Max { a[i]+a[i+1]+...+a[j] ; x ≤ i ≤ j ≤ y }.Given M queries, your program must output the results of these queries.InputT
2022-01-27 11:20:52
859
原创 A Simple Problem with Integers
You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval.The other is to ask f
2022-01-26 22:14:32
1481
原创 DZY Loves Chemistry
DZY loves chemistry, and he enjoys mixing chemicals.DZY has n chemicals, and m pairs of them will react. He wants to pour these chemicals into a test tube, and he needs to pour them in one by one, in any order.Let's consider the danger of a test tube.
2022-01-23 15:56:40
336
原创 The Way to Home
A frog lives on the axis Ox and needs to reach home which is in the point n. She starts from the point 1. The frog can jump to the right at a distance not more than d. So, after she jumped from the point x she can reach the point x + a, where a is an integ
2022-01-23 15:53:35
199
原创 Knight Moves
DescriptionBackgroundMr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him?The ProblemYour task is to write a program to calculate the minimum number of moves
2022-01-23 15:49:25
270
原创 Protect Sheep
Bob is a farmer. He has a large pasture with many sheep. Recently, he has lost some of them due to wolf attacks. He thus decided to place some shepherd dogs in such a way that all his sheep are protected.The pasture is a rectangle consisting of R × C cel
2022-01-23 15:38:52
198
原创 Maximum Product
思路:最大值,一个一个乘,然后进行比较,要是最大值还是为0的话就是做是没有的。N最大可以为18,所以max比较大,用long long。#include<iostream>#include<stdio.h>using namespace std;#define M 18int n=0;int main(){ int N; while(scanf("%d",&N)!=EOF) { int a[M]={0}; for(int i=0;..
2022-01-23 15:29:33
289
原创 驾驶卡丁车
小Q正在设计一款2D卡丁车游戏,你的任务是帮助小Q实现其中的一部分功能。在这款游戏中,游戏地图是一张 n 行 m 列的网格,从上到下依次编号为第 1 行到第 n 行,从左往右依次编号为第 1 列到第 m 列,其中第 i 行第 j 列的格子的坐标为 (i,j),每个格子要么是可以通行的平地,要么是不可通行的障碍。在地图上的某个平地格子处有一辆由玩家操控的卡丁车。卡丁车的移动速率为 vvv,并且一共有8种可能的朝向,分别为:"上":前进一步时,将从 (x,y) 移动到 (x−1,y)。 "下":前
2022-01-23 15:22:19
2496
原创 Computer Game
Monocarp is playing a computer game. Now he wants to complete the first level of this game.A level is a rectangular grid of 222 rows and nnn columns. Monocarp controls a character, which starts in cell (1,1)— at the intersection of the 1-st row and the 1
2022-01-23 15:04:02
1106
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人