![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
补题
lybbor
写的有问题可以帮我指明吗!谢谢!
展开
-
假币问题
Description居然有假币!!!事情是这样的,现在猪肉涨了,但是农民的工资却不见涨啊,没钱怎么买猪肉啊。老王这就去买猪肉,结果找来的零钱中有假币!!!可惜老王一不小心把它混进了一堆真币里面去了。现在知道假币的重量比真币的质量要轻。给你一个天平,请用最快的时间把那个可恶的假币找出来。Input输入有多行,每一行的值为硬币的数目n,1≤n≤2^30,输入0结束程序Output最少要称多少次一定能把那个假币找出来。输出对应输入行数.Sample Input31..原创 2020-11-19 15:55:17 · 745 阅读 · 0 评论 -
1249B2. Books Exchange
俺寻思就是个判环害,并查集可以写的,vector也挺简单的【老天鹅啊。。还有好多题解没补,wsl】vector:#include<bits/stdc++.h>#include <vector>typedef long long ll;using namespace std;ll a[200100];ll vis[200100];ll ans[200100...原创 2019-10-26 16:01:49 · 109 阅读 · 0 评论 -
牛客练习赛22 T3 简单瞎搞题 bitset
学长(犭)良心推荐戳我进题要用bitset来写AC代码:///:)#include <stdio.h>#include <string.h>#include <stdlib.h>#include <math.h>#include <map>#include <stack>#include <queu...原创 2019-07-04 15:27:39 · 189 阅读 · 0 评论 -
cf-573C Tokitsukaze and Discard Items
C. Tokitsukaze and Discard Items(模拟水题,刚开始思路有问题,还是参考了别人的AC代码才改对了的)AC代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;ll del[100010];int main(){ ll n,m,page; scanf("%I...原创 2019-07-14 20:52:13 · 265 阅读 · 0 评论 -
cf-1195c Basketball Exercise
C.Basketball Exercise题意:两排运动员的身高,选出运动员使总身高最大(不能出现有两个运动员是连续痛一排的,只能挨着的两个运动员是不同排位的),输出得到的最大总身高;思路:dp哈AC代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;ll dp[4][131420];...原创 2019-07-20 18:27:06 · 197 阅读 · 0 评论 -
manacher problem A
众所周知,马拉车可以查出一段字符串中最长回文串长度A题是最简单的基础题(个人觉得马拉车就是暴力。。递归了)代码如下:#include <bits/stdc++.h>using namespace std;typedef long long ll;char s[1110000];char ma[2220000];ll mp[2220000];ll manacher(l...原创 2019-08-23 20:29:25 · 137 阅读 · 0 评论 -
manacher problemB
题意:找个ABBAAB串,回文文回回文串eg: abbaab abccbaabc代码如下:#include<bits/stdc++.h>using namespace std;typedef long long ll;ll s[301314];ll mp[701314];ll num[701314];ll r;ll manacher(){ ll ...原创 2019-08-24 10:10:56 · 136 阅读 · 0 评论 -
manacher problemC
题意:爬山,前半段非递减,后半段非递增灵魂画师思路:在manacher中mp改变条件加一个跳过原来的加入的值的条件以及加一个判断控制最中间向两边满足非递增条件。Ac代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;ll s[111000];ll ma[222000];ll mp...原创 2019-08-24 11:05:40 · 126 阅读 · 0 评论 -
manacher problemD
找到字符串中共有多少个回文串,ans+map[i]/2就是最终答案了,模板题~#include <bits/stdc++.h>using namespace std;typedef long long ll;char s[111000];char ma[222000];ll mp[222000];ll ans=0;ll manacher(ll len){ ...原创 2019-11-06 09:28:15 · 111 阅读 · 2 评论 -
poj 3190 贪心+优先队列
戳我进题DescriptionOh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A…B (1 <= A <= B <= 1,000,000), which incl...原创 2019-07-04 11:51:12 · 134 阅读 · 0 评论 -
CF-573B Tokitsukaze and Mahjong
不会打麻将的四川人表示难受,就是shuntsu和koutsu(顺子和kou子?世贤的疑惑.jpg)题意:可以1s,2s,3s 不可以1s,2m,3s;(单位相同,数字顺序)可以1s,1s,1s,不可以1m,1s,1p;(单位相同,数字相同)思路:把每张牌用int型数组,单位是十位,点数是个位,存下来,然后遍历这三张牌分别加三后有没有出现过(注意数字为7-9时)关键部分:int ans...原创 2019-07-13 11:31:17 · 239 阅读 · 0 评论 -
HDU 5210
WLD likes playing with numbers. One day he is playing with N integers. He wants to delete K integers from them. He likes diversity, so he wants to keep the kinds of different integers as many as possi...原创 2019-07-02 10:39:18 · 86 阅读 · 0 评论 -
radar
DescribeAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locatin...原创 2019-07-02 15:43:42 · 146 阅读 · 0 评论 -
cf-Add More Zero
点击此处进入题目或点击此链接:https://codeforc.es/gym/102253/problem/A化简为公式log10(pow(2,m))m*log10(2)AC代码#include <stdio.h>#include <string>#include <stdlib.h>#include <math.h>#in...原创 2019-07-02 16:49:56 · 164 阅读 · 0 评论 -
POJ 1862 Stripies
输入浮点数,不是整型贪心水题AC代码:#include <stdio.h>#include <string>#include <stdlib.h>#include <math.h>#include <map>#include <algorithm>#include <iostream>using...原创 2019-07-02 17:08:04 · 98 阅读 · 0 评论 -
poj 3262 protect the flowers
DescribeFarmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the cluster of cows was in his garden eating his ...原创 2019-07-03 09:29:20 · 117 阅读 · 0 评论 -
yogurt factory
(先写上,有空补一下)DescribeThe cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk and labor will fluctuate weekly su...原创 2019-07-03 11:28:05 · 207 阅读 · 0 评论 -
poj 3069 Saruman‘s Army
DescriptionSaruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troop...原创 2019-07-03 20:59:26 · 132 阅读 · 0 评论 -
NSUOJ zser的棋盘
思路:i行里面找一个j列能存放棋子的位置来放置棋子,然后改变这一列的vis,继续下一行,找个符合的列关键代码:for(int i=s;i<m;i++){ for(int j=0;j<m;j++) { if(!vis[j]&&maze[i][j]=='#') { vis[j]=1; ...原创 2019-07-09 15:10:53 · 197 阅读 · 1 评论 -
田忌赛马思路+代码
先写一下cmp函数bool cmp(int a,int b){ return a>b;}sort(x,x+n)是从小到大,cmp函数里写a>b实现从大到小,写a<b实现从小到大sort(x,x+n,cmp);原创 2019-07-02 08:41:28 · 1022 阅读 · 2 评论