![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
模拟和思维
心悦灵溪
这个作者很懒,什么都没留下…
展开
-
牛客练习赛60 B-三角形周长和 【暴力】
B-三角形周长和 解题思路:因为n是1000,所以直接 O(n2) 去枚举所有边,那么每一条边显然会在其他n−2个三角形中出现,这个就是这条边的贡献系数,这题就算完了。AC代码:#include<iostream>#include<algorithm>#include<cstring>#include<cstdio>#inc...原创 2020-03-28 18:34:11 · 161 阅读 · 0 评论 -
牛客练习赛60 A-大吉大利 【思维】
传送门:A-大吉大利.链接:https://ac.nowcoder.com/acm/contest/4853/A来源:牛客网题目描述给定n个整数,依次为a1 ,a2,…,an。求∑i=1n∑j=1n(ai&aj)\sum_{i = 1}^n\sum_{j = 1}^n(a_i\&a_j)∑i=1n∑j=1n(ai&aj)。“&”是二进制的...原创 2020-03-28 17:26:19 · 168 阅读 · 0 评论 -
HDU 5573 Binary Tree 【二进制+思维】
传送门:HDU 5573Binary TreeProblem DescriptionThe Old Frog King lives on the root of an infinite tree. According to the law, each node should connect to exactly two nodes on the next level, forming...原创 2020-03-19 15:43:08 · 145 阅读 · 0 评论 -
HDU 5584 LCM Walk 【数学+思维+逆推】
HDU 5584LCM Walk Problem DescriptionA frog has just learned some number theory, and can’t wait to show his ability to his girlfriend.Now the frog is sitting on a grid map of infinite rows and ...原创 2020-03-15 21:45:16 · 270 阅读 · 0 评论 -
PAT练习题 甲级P1029 Median (25分)【求中位数】
传送门:P1029将两个序列合并,分奇偶找中值AC代码:#include<iostream>#include<algorithm>#include<cstring>#define ll long longusing namespace std;const int N=1e6+10;int n;ll num[N];int main(...原创 2020-03-05 18:55:25 · 206 阅读 · 0 评论 -
PAT练习题 甲级P1028
传送门:P1028AC代码:#include<iostream>#include<algorithm>#include<cstring>#include<cstdio>#include<string>#define ll long longusing namespace std;int n,c;struct st...原创 2020-03-05 18:34:19 · 116 阅读 · 0 评论 -
PAT练习题 P1027 Colors in Mars (20分)【进制转换】
传送门:P1027就是将给你的三个十进制的数转换成十三进制输出。AC代码:#include<iostream>#include<algorithm>#include<cstring>#include<cstdio>#include<cmath>#define ll long long#define inf 0x...原创 2020-03-05 18:07:25 · 122 阅读 · 0 评论 -
PAT练习题 P1025 PAT Ranking (25分)【结构体水题】
传送门:P1025水题,构造一个结构体,存下 考生id ,组号,成绩。每组输入结束都进行一次排序,将每组的排名记下。最后再进行一次排序,将最终成绩记下。AC代码:#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using nam...原创 2020-03-04 20:34:46 · 143 阅读 · 0 评论 -
Codeforces 1321B Journey Planning 【思维】
传送门:Codeforces 1321BJourney Planningtime limit per test: 2 secondsmemory limit per test: 256 megabytesTanya wants to go on a journey across the cities of Berland. There are n cities situated a...原创 2020-03-02 17:19:08 · 540 阅读 · 0 评论 -
Codeforces 1321A Contest for Robots
传送门:Codeforces 1321A题目大意:两个公司 R 和 B 进行比赛,我们希望 R 公司赢。以答题的形式来得分,事先告诉你每个公司可以完成的工作 1表示可以完成,0则反之。我们可以通过暗箱操作的方式调整题目的分数,来使 R 公司胜利,但是为了避免不会太假,所以要求我们题目的最高分要尽量小。解题思路:去除两个公司都能得分的题目,剩下 B 公司可以完成的 x 题都以最小分...原创 2020-03-02 16:57:06 · 615 阅读 · 0 评论 -
PAT练习题 P1012 The Best Rank (25分) 【结构体运用】
传送门:P1012P1012 The Best Rank (25分)To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (...原创 2020-02-24 11:14:58 · 177 阅读 · 0 评论 -
PAT练习题 P1010 Radix (25分)【二分匹配】
传送门:P1010P1010 Radix (25分)Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number.No...原创 2020-02-23 22:28:12 · 192 阅读 · 0 评论 -
PAT练习题 1009 Product of Polynomials(25分)多项式乘法
传送门:10091009 Product of Polynomials (25分)This time, you are supposed to find A×B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupie...原创 2020-02-23 16:29:33 · 212 阅读 · 0 评论 -
Codeforces 1244E Minimizing Difference 【二分+思维】
传送门:Minimizing DifferenceE.Minimizing Differencetime limit per test: 2 secondsYou are given a sequence a1,a2,…,an consisting of n integers.You may perform the following operation on this seque...原创 2019-10-15 10:21:23 · 357 阅读 · 0 评论 -
Codeforces 1238D AB-string 【思维题】
传送门:Codeforces 1238DD. AB-stringtime limit per test2 secondsmemory limit per test256 megabytesThe string t1 t2…tk is good if each letter of this string belongs to at least one palindrome of le...原创 2019-10-11 17:25:53 · 438 阅读 · 0 评论 -
Codeforces 1194B+1194D
传送门:1194B传送门:1194DB. Yet Another Crosses Problem#include<iostream>#include<algorithm>#include<cstring>#define ll long longusing namespace std;int n, m;string g[50005]...原创 2019-07-15 16:12:47 · 294 阅读 · 0 评论 -
A. Rooms and Passages 【思维】
/// .-~~~~~~~~~-._ _.-~~~~~~~~~-./// __.' ~. .~ `.__/// .'// \./ \\`./// .'// ...原创 2019-07-15 21:44:08 · 534 阅读 · 0 评论 -
GYM 101061G
传送门:GYM 101061G G. Repeat ittime limit per test2.0 smemory limit per test64 MBinputstandard inputoutputstandard outputProblem DescriptionJad has bought a new computer, a really weird comput...原创 2019-07-22 15:56:30 · 314 阅读 · 0 评论 -
HDU 2772 Matchsticks 【数学+规律】
传送门:HDU 2772MatchsticksTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionMatchsticks are ideal tools to represent numbers. A common way to r...原创 2019-07-26 20:31:39 · 336 阅读 · 0 评论 -
Gym 101116A Assembly Required 【思维】
传送门:Gym 101116AAssembly RequiredPrincess Lucy broke her old reading lamp, and needs a new one. The castle orders a shipment of parts fromthe Slick Lamp Parts Company, which produces interchanga...原创 2019-07-31 21:00:56 · 108 阅读 · 0 评论 -
Codeforces 1198A MP3
传送门:MP3MP3One common way of digitalizing sound is to record sound intensity at particular time moments. For each time moment intensity is recorded as a non-negative integer. Thus we can represen...原创 2019-08-01 15:00:05 · 408 阅读 · 0 评论 -
Codeforces 1198B Welfare State 【线段树或思维】
传送门:Codeforces 1198BWelfare StateThere is a country with n citizens. The i-th of them initially has ai money. The government strictly controls the wealth of its citizens. Whenever a citizen make...原创 2019-08-01 17:50:50 · 402 阅读 · 0 评论 -
Gym - 101911A Coffee Break【set+二分】
传送门:Gym - 101911ACoffee Breaktime limit per test2.0 smemory limit per test256 MBRecently Monocarp got a job. His working day lasts exactly m minutes. During work, Monocarp wants to drink coffe...原创 2019-08-11 09:52:13 · 115 阅读 · 0 评论 -
Gym - 102021E Expired License 【数学】
传送门:Gym - 102021EPaul is an extremely gifted computer scientist who just completed his master’s degree at aprestigious German university. Now he would like to culminate his academic career in a ...原创 2019-08-15 21:40:13 · 153 阅读 · 0 评论 -
Gym - 102021L Logic Puzzle 【思维】
传送门:Logic PuzzleProblem L: Logic PuzzleWhile browsing a kiosk at a recent trip, you bought a magazine filled with various kinds of logicpuzzles. After a while of solving, however, you start to ...原创 2019-08-16 15:09:49 · 382 阅读 · 5 评论 -
ACM-ICPC 2017 Asia Nanning j题 Rearrangement【思维】
传送门:RearrangementRearrangementIn a two dimensional array of integers of size 2 \times n2×n, is it possible to rearrange integers so that the sum of two adjacent elements (which are adjacent in a...原创 2019-09-05 20:43:09 · 146 阅读 · 0 评论 -
2018icpc沈阳站G题
传送门:Best ACMer Solves the Hardest ProblemBest ACMer Solves the Hardest ProblemTime limit12000 ms Memory limit1048576 kBOne day an excellent ACMer will leave the field to face new challenges, ju...原创 2019-10-05 17:06:06 · 534 阅读 · 0 评论 -
HDU 5920 Ugly Problem 贪心+模拟(大数)
传送门:HDU 5920原创 2019-07-14 19:56:33 · 169 阅读 · 0 评论