![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 78
NG KIM-BING
写给自己看的博客~
展开
-
2019 Multi-University Training Contest 4 1010 | HDU 6623 Minimal Power of Prime
Problem DescriptionYou are given a positive integer n > 1. Consider all the different prime divisors of n. Each of them is included in the expansion n into prime factors in some degree. Required t...原创 2019-07-31 20:29:40 · 528 阅读 · 0 评论 -
2019牛客暑期多校训练营(第五场) maximum clique 1 (Hungary, 二分图最小点覆盖,二分图最大独立集)
链接:https://ac.nowcoder.com/acm/contest/885/F来源:牛客网题目描述You are given a set S containing n distinct positive integers a_1, a_2 … a_nPlease find a subset of S which has the maximum size while satisfy...原创 2019-08-02 14:49:55 · 598 阅读 · 0 评论 -
2018 ACM ICPC – Notheast Preliminary Regional Qualifier H. The Words are Restless
The Words are RestlessProblem DescriptionPalindromes, strings that are the same forward and backward, get far too much attention, and everyday words are upset. Sure a racecar is fast, but the pen is...原创 2019-08-18 17:48:11 · 796 阅读 · 0 评论 -
2018 ACM ICPC – Notheast Preliminary Regional Qualifier I. Water on the Stairs
Water on the StairsProblem DescriptionYou are the manager for Stair World amusement park, a 2-dimensional theme park that specializes in death-defying staircase walks (otherwise known as “rides”) fo...原创 2019-08-18 18:00:05 · 981 阅读 · 0 评论 -
2018 ACM ICPC – Notheast Preliminary Regional Qualifier I. Knight's Tour
Knight’s TourProblem DescriptionIn the board game chess, the knight can move in a L shape, moving 2 squares in one direction and 1 square in a perpendicular direction. Here are the 8 possible moves ...原创 2019-08-18 18:23:06 · 1530 阅读 · 0 评论 -
2018 ACM ICPC – Notheast Preliminary Regional Qualifier E. Karma Dice
Karma DiceProblem DescriptionRajas of the Ganges is a board game released in late 2017. Each player rolls dice during the game and uses the numbers on the dice to make various plays. One of these pl...原创 2019-08-18 18:33:53 · 1599 阅读 · 0 评论 -
2019 Multi-University Training Contest 7 A + B = C(思维)
第四个小时才从睡梦中醒来。。。匆匆忙忙乱搞了一份交上去。。TLE…A + B = CTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1655 Accepted Submission(s): 363Special Judg...原创 2019-08-13 22:00:43 · 509 阅读 · 0 评论 -
牛客假日团队赛11 部分题解【为了抽奖闲来做题】
链接:https://ac.nowcoder.com/acm/contest/1077/A来源:牛客网A.级数求和题目描述已知:Sn= 1+1/2+1/3+…+1/n。显然对于任意一个整数K,当n足够大的时候,Sn大于K。现给出一个整数K(1<=k<=15),要求计算出一个最小的n;使得Sn>K。输入描述:输入k输出描述:输出n输入1输出2Solut...原创 2019-08-19 00:28:32 · 1839 阅读 · 0 评论 -
2019牛客暑期多校训练营(第六场) Move
链接:https://ac.nowcoder.com/acm/contest/886/D来源:牛客网题目描述After the struggle of graduating from college, TangTang is about to move from a student apartment to his new home.TangTang has n items to move...原创 2019-08-09 18:34:27 · 559 阅读 · 0 评论 -
2019牛客暑期多校训练营(第七场)Irreducible Polynomial (数学)
链接:https://ac.nowcoder.com/acm/contest/887/B来源:牛客网题目描述输入描述:输出描述:For each test case, output “Yes” if it is irreducible, otherwise “No”.输入221 -2 121 0 1输出NoYesSolution 一开始想到通过判断有...原创 2019-08-09 18:42:20 · 560 阅读 · 0 评论 -
HNU2019 Summer Training 3 B. Broken Watch
Problem DescriptionA UFO crash lands on Earth. The alien captain survives the crash relatively unscathed; however his trusty watch is dam...原创 2019-07-28 20:38:55 · 771 阅读 · 0 评论 -
HNU2019 Summer Training 4 E.Fishermen
Problem DescriptionThe ocean can be represented as the first quarter of the Cartesian plane. There are n fish in the ocean. Each fish has...原创 2019-07-28 20:30:19 · 709 阅读 · 2 评论 -
2019牛客暑期多校训练营(第三场) D. Big Integer
链接:https://ac.nowcoder.com/acm/contest/883/D来源:牛客网Problem DescriptionInput Sample211 8 17 6 2Output Sample42Solution:由于9p不是质数,所以应该用mod p来做题,但是由于3与9不是互质的,故p=3的情况不能把9消掉,需要老老实实的用mod 9p...原创 2019-07-26 22:33:42 · 540 阅读 · 0 评论 -
2019牛客暑期多校训练营(第三场) F. Planting Trees
Problem DescriptionInput Sample22 01 22 13 11 3 22 3 13 2 1Output Sample42题目大意给定二维数组aij,要在其中选尽可能大的矩形,使得矩形中最大的a和最小的a值的差距不超过mSolution:枚举上下又区间,用单调队列维护左区间,具体见代码AC Code:/* * Copyr...原创 2019-07-26 22:39:16 · 535 阅读 · 0 评论 -
2019 Multi-University Training Contest 1 D. Vacation
Problem DescriptionTom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are n cars in front of them. The ith...原创 2019-07-23 12:49:46 · 565 阅读 · 0 评论 -
HNU2019 Summer Training 3 E. Blurred Pictures
Problem DescriptionDamon loves to take photos of the places he visits during his travels, to put them into frames. All of his photos are in a square format of N x N pixels. He brought back beautiful...原创 2019-07-28 00:41:10 · 1293 阅读 · 0 评论 -
HNU2019 Summer Training 3 E. Rounding
Problem DescriptionYou decided to stay an extra day in Paris visiting favorite places of Parisians around Télécom ParisTech. You want to collect information about these favorite places, but asking peo...原创 2019-07-28 00:45:20 · 997 阅读 · 0 评论 -
2019杭电多校5 1005. permutation 1 (dfs,暴力)
养成了看群决定有没比赛的习惯因为今天群里没动静以为今天没比赛 导致这场杭电没去做 对不住队友Q^Q permutation 1Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 0 Accepted Su...原创 2019-08-05 20:14:43 · 608 阅读 · 0 评论 -
2019杭电多校5 1007. permutation 2 (dp)
permutation 2Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionYou are given three positiv...原创 2019-08-05 22:13:48 · 575 阅读 · 0 评论 -
2019牛客暑期多校训练营three points 1
链接:https://ac.nowcoder.com/acm/contest/885/I来源:牛客网题目描述You are given five positive integers w, h, a, b, c. Please construct 3 points X, Y, Z in the 2-dimensional plane such that the distance between...原创 2019-08-01 21:24:20 · 556 阅读 · 0 评论 -
2019牛客暑期多校训练营(第七场) String (字符串,暴力)
链接:https://ac.nowcoder.com/acm/contest/887/A来源:牛客网题目描述A string is perfect if it has the smallest lexicographical ordering among its cyclic rotations.For example: “0101” is perfect as it is the sma...原创 2019-08-09 18:52:42 · 608 阅读 · 0 评论 -
自编写简易OJ 【用于日常ACM训练,数据测试】(待完善)
今天下午算是被一题的数据恶心到了。。测试了一下午 WA了一下午,至今不知道是什么样例错了。。题目数据还没发出来,先写好代码准备迎接他!(*`・з・)ムッ (▼皿▼#)另外庆祝CSDN发博客终于取消掉文章分类这个框了(每次填那个框框都可尴尬了)使用方法:如下图,在前后附加代码效果:查看当前目录下的judge.result文件代码实现:头文件:static stora...原创 2019-08-19 20:09:22 · 1992 阅读 · 0 评论 -
Rikka with Coin (思维)
Rikka with CoinTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 580 Accepted Submission(s): 144Problem DescriptionRikka hates coins, and...原创 2019-08-20 00:46:57 · 1674 阅读 · 0 评论 -
K-th Number POJ - 2104 (主席树 | 划分树)(附动态区间主席树模板)
K-th Number POJ - 2104You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would...原创 2019-09-13 10:45:18 · 1543 阅读 · 0 评论 -
Codeforces Round #397 765E - Tree Folding
E. Tree Foldingtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputVanya wants to minimize a tree. He can perform the following operation multipl...原创 2019-09-14 10:02:51 · 1536 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Shenyang 2019 D.Fish eating fruit (容斥,点分治)
State Z is a underwater kingdom of the Atlantic Ocean. This country is amazing. There are nnn cities in the country and n−1n-1n−1 undirected underwater roads which connect all cities.In order to save ...原创 2019-09-14 22:10:29 · 1538 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Shenyang 2019 F. Honk's pool ( 模拟)
F. Honk’s poolAs we all know, Honk has nnn pools, numbered as 111 ~ nnn . There is aia_iai liters water in the iii-th pool. Every day, Honk will perform the following operations in sequence.Find the...原创 2019-09-14 22:17:18 · 1515 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Shenyang 2019H. Texas hold'em Poker(模拟)
编辑代码 17.16% 1000ms 262144K ...原创 2019-09-14 22:22:11 · 1558 阅读 · 0 评论 -
AtCoder Beginner Contest 141 F-XOR Sum 3(线性基)
F - Xor Sum 3 Time Limit: 2 sec / Memory Limit: 1024 MB <div id="task-statement"> <span class="lang">配点: 600600 点問題文NN となります。制約入力はすべて整数2≤N≤1052≤N≤105入力...原创 2019-09-15 23:34:46 · 1662 阅读 · 0 评论 -
AtCoder Beginner Contest 141. E - Who Says a Pun? (后缀数组)
https://atcoder.jp/contests/abc141/tasks/abc141_eAC Code(Suffix array)[A foolish way to solve the problem]//#include<bits/stdc++.h>#include<iostream>#include<cstdio>#include&l...原创 2019-09-15 23:42:35 · 1589 阅读 · 0 评论 -
记两条扫描线的题目 Rectangles(线段树),Intersecting Rectangles
Intersecting Rectangles大致意思是给定n个矩形,问是否会存在相交直接套扫描线区分左边和右边,如果在还没抵消时发现区间已经有数值,说明会相交AC Code:// http://115.157.200.87/front/problem?problemId=1202#include <iostream>#include <vector>#in...原创 2019-09-26 12:41:02 · 1422 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Nanjing 2019 B. super_log (欧拉函数)(数论)
In Complexity theory, some functions are nearly O(1)O(1)O(1), but it is greater then O(1)O(1)O(1). For example, the complexity of a typical disjoint set is O(nα(n))O(nα(n))O(nα(n)). Here α(n)α(n)α(n) ...原创 2019-09-02 21:23:53 · 1531 阅读 · 0 评论 -
HNU2019暑期训练赛之7 F. Left-Right-Win
Problem DescriptionThe game of Left-Right-Win is played by n players around a table with a spinner* which returns Leftwith probability P_left, Right with probability P_right and Win with probability...原创 2019-08-10 20:54:02 · 771 阅读 · 0 评论 -
STL inline bool next_permutation(iterator first, iterator last)实现
不得不说,c++源码读起来也太难受了不过其实仔细看看,其实还是挺好的原理是找到最后一个相邻的升序元素,假设他们分别是a[i]和a[ii],找到后,再找到最后一个比a[i]大的下标j, 将a[i]和a[j]交换后,再把ii以后的全部元素反转(如果找不到相邻的升序元素,说明所有元素都是非升的,那么久找不到下一个排列,return false)例如 1 3 5 9 7 4找到...原创 2019-08-11 11:13:54 · 479 阅读 · 0 评论 -
2018 East Central Regional Contest/ ECNA2018 E.The Punctilious Cruciverbalist
Problem DescriptionA crossword puzzle consists of a grid of squares in which intersecting words are placed, one letter per square. Some grid squares are filled black indicating that no letter should ...原创 2019-08-17 20:26:05 · 614 阅读 · 0 评论 -
2018 East Central Regional Contest/ ECNA2018 C.Pear-wise Voting (dfs)
Problem DescriptionBob Roberts is ending his term as president of a local group of fruit aficionados call the Pear-wise Club. Being president is a plum position so many people are running, some of wh...原创 2019-08-17 20:53:51 · 623 阅读 · 0 评论 -
2018 East Central Regional Contest/ ECNA2018 A. Car Vet (dfs)
Problem DescriptionBob Roberts is the self proclaimed “Car Vet” who owns several junk car lots where people can come and search for spare parts for their (ailing) cars. The cars in each lot are parke...原创 2019-08-18 11:12:49 · 763 阅读 · 0 评论 -
HNU 2019暑期训练赛之10
J. Jurassic JigsawProblem DescriptionThe famous Jurassic park biologist Dean O’Saur has dis- covered new samples of what he expects to be the DNA of a dinosaur. With the help of his assistant Petra...原创 2019-08-31 19:00:32 · 1767 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Nanjing 2019 A. The beautiful values of the palace(离散化、树状数组)
https://nanti.jisuanke.com/t/41298Here is a square matrix of n∗nn * nn∗n, each lattice has its value (nnn must be odd), and the center value is n∗nn * nn∗n. Its spiral decline along the center of the...原创 2019-09-02 21:04:45 · 1507 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Nanjing 2019 H. Holy Grail (图论,负权图)
As the current heir of a wizarding family with a long history,unfortunately, you find yourself forced to participate in the cruel Holy Grail War which has a reincarnation of sixty years.However,fortun...原创 2019-09-02 21:10:17 · 1484 阅读 · 0 评论