思维
文章平均质量分 58
Prime me
Nobody can defeat me unless I don't want to win.
展开
-
Xor Transformation(第 45 届国际大学生程序设计竞赛(ICPC)亚洲区域赛(济南))
MianKing has one integer XX, he wants to perform some operations to transform XX to YY (Y<X)(Y<X).In each operation, MianKing can choose one integer 0\leq A<X0≤A<X and let X=XxorAX=X xor A.It’s noticed that after an operation, the upper boun.原创 2021-11-19 19:58:36 · 506 阅读 · 0 评论 -
Nun Heh Heh Aaaaaaaaaaa(CCPC网络赛补题)(线性dp+后缀和+思维)
Problem DescriptionVasily Tadokorov is a stringologist. He thinks a string is fragrant if it can be divided into two parts — nunhehheh as the prefix and a number of (excluding 0) a as the suffix. For example, nunhehhehaaaaaa is fragrant, but nunhehheh an.原创 2021-11-05 20:58:31 · 145 阅读 · 0 评论 -
J Leaking Roof
Grandpa Are lives in an old house. Now it is the heavy rain that occurs only once in a hundred years, but the roof of Grandpa Are’s house leaks. His roof can be viewed as a n×n grid, and each square has a height. Denote the height of the square with coord.原创 2021-10-09 14:45:43 · 132 阅读 · 0 评论 -
1001 A+B Format (20 分)
Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input file contains one test case. Each case contains a pair of .原创 2021-10-09 12:38:48 · 40 阅读 · 0 评论 -
K Segment Routing
Segment Routing over IPv6 is a next-generation IP bearer protocol.In traditional IP routing, an IP packet sent from a source host goes through multiple routers and then reaches the destination host. Each router checks the destination IP address inside th.原创 2021-09-23 22:02:03 · 114 阅读 · 0 评论 -
H Mesh Analysis
In computer graphics (CG), it is general to use a triangle mesh to represent the surface of an object.The 3-D points in a CG program form multiple connected line segments and triangles, which are in turn organized as a triangle mesh. You are asked to fin.原创 2021-09-23 20:36:53 · 137 阅读 · 0 评论 -
F Land Overseer
The role of Keqing, Yuheng of the Liyue Qixing, is to manage real estate and construction in Liyue.Today Keqing decides to leave her office, and visit two places - Chasm, and Jueyun Karst - to make sure the building progress there is at a reasonable pace.原创 2021-09-23 19:54:49 · 111 阅读 · 0 评论 -
B. Combinatorics Homework
You are given four integer values a, b, c and m.Check if there exists a string that contains:a letters ‘A’;b letters ‘B’;c letters ‘C’;no other letters;exactly m pairs of adjacent equal letters (exactly m such positions i that the i-th letter is equ.原创 2021-09-21 20:27:02 · 210 阅读 · 0 评论 -
A - Make 10
https://atcoder.jp/contests/arc126/tasks/arc126_a题面We have N2 sticks of length 2 each, N3 sticks of length 3 each, and N4 sticks of length 4 each. You can do the following operation any number of times.Choose two sticks.Let x and y be the lengths of.原创 2021-09-20 09:57:14 · 140 阅读 · 0 评论 -
B - Mocha and Red and Blue (CodeForces - 1559B)
As their story unravels, a timeless tale is told once again…Shirahime, a friend of Mocha’s, is keen on playing the music game Arcaea and sharing Mocha interesting puzzles to solve. This day, Shirahime comes up with a new simple puzzle and wants Mocha to .原创 2021-08-17 20:48:02 · 261 阅读 · 0 评论 -
Mocha and Math(CodeForces - 1559A )
Mocha is a young girl from high school. She has learned so much interesting knowledge from her teachers, especially her math teacher. Recently, Mocha is learning about binary system and very interested in bitwise operation.This day, Mocha got a sequence .原创 2021-08-17 19:58:07 · 287 阅读 · 0 评论 -
Largest Rectangle in a Histogram(单调队列)
A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows the histogram that consists of rectangles with the heig.原创 2021-08-01 14:53:58 · 74 阅读 · 0 评论 -
D - Diane
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such st.原创 2021-07-30 22:07:40 · 128 阅读 · 0 评论 -
Cobb(数据估计处理)
You are given n integers a1,a2,…,an and an integer k. Find the maximum value of i⋅j−k⋅(ai|aj) over all pairs (i,j) of integers with 1≤i<j≤n. Here, | is the bitwise OR operator.InputThe first line contains a single integer t (1≤t≤10000) — the number .原创 2021-07-30 21:37:41 · 309 阅读 · 0 评论 -
B - Maximum Cost Deletion
#include<iostream>#include<string>using namespace std;int main(){ int N,js,sum,n, a, b; string str; cin >> N; while (N--) { js=1; cin >> n >> a >> b ; cin >> str;原创 2021-07-27 22:05:53 · 104 阅读 · 0 评论 -
A - Find The Array
#include<bits/stdc++.h>using namespace std;int main(){ int t; cin>>t; while(t--) { int s ; cin>>s; int x = sqrt(s); if(x * x < s) x += 1; printf("%d\n", x); }原创 2021-07-27 21:22:20 · 43 阅读 · 0 评论 -
C - Double-ended Strings
C - Double-ended Strings题解题解:题意中让找出在字符串a==b(注意:当a,b字符串都为空时也视为相等),给出的操作方式就是删除,所以我们只需要找出他们相同的子串,求出子串的长度,然后用他们两个原字符串长度求和再减去相同子串长度的二倍就是剩下该删除的也就是求出的操作步数。#include<iostream>#include<math.h>using namespace std;int main(){ int t; cin&.原创 2021-04-04 19:01:41 · 158 阅读 · 1 评论