-------------acm题解--------
文章平均质量分 72
small__snail__5
如果有一天您来到了这里请留下您的痕迹,欢迎各种评论,一同进步。
我愿意做一只小蜗牛,不艳羡别人的速度,而独享自己的慢慢旅程,总有一天,我也可以骄傲的告诉所有人,我虽然慢,但是我不曾放弃,人生总要坚持点什么。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
sdut3257(质因数分解平方和)
H - Square NumberTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatusPracticeSDUT 3258 use MathJax to parse formulasDescriptionIn mathematics, a s原创 2017-05-01 11:57:42 · 768 阅读 · 0 评论 -
hdu4310
When playing DotA with god-like rivals and pig-like team members, you have to face an embarrassing situation: All your teammates are killed, and you have to fight 1vN.There are two key attribute原创 2017-05-02 15:56:17 · 474 阅读 · 0 评论 -
poj3104(二分)
#include #include #include #include using namespace std;typedef long long ll;ll n, k;ll a[200000];bool dix(int mid)//枚举的是自然风干时间{ ll time = 0; if(k == 1) return true; for(int i =原创 2017-04-16 17:00:36 · 421 阅读 · 0 评论 -
poj1019
A single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of positive integer n原创 2017-05-02 10:01:30 · 425 阅读 · 0 评论 -
hdu2057
There must be many A + B problems in our HDOJ , now a new one is coming.Give you two hexadecimal integers , your task is to calculate the sum of them,and print it in hexadecimal too.Easy ? AC原创 2017-05-02 09:15:09 · 375 阅读 · 0 评论 -
csu1777
输入两个实数,判断第一个数大,第二个数大还是一样大。每个数的格式为:[整数部分].[小数部分] 简单起见,整数部分和小数部分都保证非空,且整数部分不会有前导 0。不过,小数部分的最 后可以有 0,因此 0.0 和 0.000 是一样大的。Input 输入包含不超过 20 组数据。每组数据包含一行,有两个实数(格式如前所述)。每个实数都 包含不超过 100 个字符。原创 2017-05-01 23:55:31 · 504 阅读 · 0 评论 -
poj2503(stl, map ,sscanf)
#include #include #include #include #include using namespace std;int main(){ char c1[30], c2[30], c3[30]; string ss; maps; while(gets(c1)){ if(strlen(c1) == 0) break;原创 2017-04-15 21:37:17 · 311 阅读 · 0 评论 -
poj3190(贪心,优先队列)
#include#include#include#includeusing namespace std;struct p{ int x; int y; int z; friend bool operator<(p n1,p n2)//维护一个优先队列 { return n1.y>n2.y; }} a[50010];bo原创 2017-04-15 21:08:38 · 281 阅读 · 0 评论 -
poj2051优先队列
#include #include #include #include #include using namespace std;struct node{ int id; int next_time; int numm; //这个是为了好算加的 friend bool operator < (const node n1, const node n原创 2017-04-15 21:06:40 · 316 阅读 · 0 评论 -
poj3273(二分枚举)
/*这个二分枚举注意的是不要超时, 以往的二分方法这里需要注意优化一下函数中将有注释*/#include #include #include #include using namespace std;const int maxn = 100010;int a[maxn];int n, m;int solve(int mid){ int sum = 0; i原创 2017-04-19 17:39:49 · 505 阅读 · 0 评论 -
hdu1018
In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you h原创 2017-05-01 22:31:14 · 458 阅读 · 0 评论 -
poj2635(素数表)
The young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in his company. The cryptographic keys are create原创 2017-05-01 16:11:06 · 472 阅读 · 0 评论 -
sdut3257(质因数分解)立方和数
G - Cube NumberTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatusPracticeSDUT 3257 use MathJax to parse formulasDescriptionIn mathematics, a cub原创 2017-05-01 15:56:31 · 925 阅读 · 0 评论 -
hdu4864(贪心)
Today the company has m tasks to complete. The ith task need xi minutes to complete. Meanwhile, this task has a difficulty level yi. The machine whose level below this task’s level yi cannot complete原创 2017-05-03 10:22:25 · 832 阅读 · 0 评论 -
蚂蚁感冒蓝桥杯(这个题nyoj有后台数据所以我的代码是有说服力的直接1A)
/*这个题思路将数字忽略符号排序再讲符号加上,然后判断感冒蚂蚁的方向2种情况,若在与之迎面而来的方向上没有蚂蚁则永远为1,若有则在计算身后与自己方向相同的蚂蚁数量即可详情见代码*/#include #include #include #include #include using namespace std;int num1[200]; //原始 int num2[200]; /原创 2017-04-06 15:16:12 · 506 阅读 · 0 评论 -
Lowest Unique Price (第六届省赛)map
/*此题一定是一个大模拟map*/#include #include #include #include #include using namespace std;int main(){ int t; scanf("%d", &t); while(t--){ map s; s.clear(); int原创 2017-04-30 15:49:59 · 343 阅读 · 0 评论 -
poj2833(优先队列)
#include #include #include #include #include using namespace std;typedef long long ll;int main(){ int n1, n2, n; while(scanf("%d%d%d", &n1, &n2, &n) != EOF && (n1 + n2 + n)){原创 2017-04-29 19:38:19 · 540 阅读 · 0 评论 -
hdu2050(递推)
/*不管折现 我们考虑直线的话那么 ,多一条线多一个点,那么折线类似自己画一下因为自己不可能和自己相交所以多一条折线多,多2*n个点,那么面数比多出来的点数多1所以就有了公式,a[j] = a[j-1] + 4*(j-1) + 1*/#include #include using namespace std;typedef long long ll;ll a[10010];in原创 2017-04-29 16:31:38 · 318 阅读 · 0 评论 -
hdu1009(贪心)
/*贪心策略按照性价比排序,买的话每一次只买性价比最高的*/#include #include #include #include #include using namespace std;struct node{ int pean, cat; double core;//性价比 bool operator < (const node a) const{原创 2017-04-29 14:35:32 · 418 阅读 · 0 评论 -
codeforce789A
/*哇比赛时候vj炸了,去codeforce交题就有一种万分期待的感觉虽然题不难直接1A但是心里还是很舒服啊*//*这个题的思路是通过三个计数器计数,将大于k的与小于k的分为两组并统计数量cnt1,cnt2,还有一个总的计数器cnt计最终答案,通过对2*k取余各种操作完成详情看代码*/#include #include #include #include using namespace原创 2017-04-05 21:58:17 · 408 阅读 · 0 评论 -
hdu1263(map(自己定义的数据结构的map))
/*在自己定义的一个结构体中的map的运用和调用*/#include #include #include #include #include using namespace std;struct myst{ map mp;//由于输出的原意需要自己定义};int main(){ int t, n; scanf("%d", &t); map原创 2017-04-29 13:05:51 · 470 阅读 · 0 评论 -
hdu1075(map)
/*相当于你输入的串有个对照表,若该船和对照表中的串相同,那么输出对照表中的串*/#include #include #include #include #include using namespace std;char c[3010];map mp;int main(){ string s1, s2; cin >> s1; while(cin原创 2017-04-29 09:36:08 · 368 阅读 · 0 评论 -
poj1064(二分)
/*题目是告诉你n根绳子,将其平均分为k等份,求出这个长度的值二分每份的长度判断是否等于k等份实时维护最大值*/#include #include #include #include #include using namespace std;int type[15000];int main(){ int n, k; while(scanf("%d%d", &原创 2017-04-28 16:17:03 · 553 阅读 · 0 评论 -
codeforce 4C
/*通过计数很简单的模拟stl*/#include #include #include #include #include using namespace std;int main(){ int n; while(cin >> n){ map mp; for(int i = 0; i < n; i++){原创 2017-04-13 17:32:33 · 416 阅读 · 0 评论 -
codeforce 748B
/*通过map将其对应的字母对应起来,注意:1.该字母是否已经对应过(此题的关键,博主用了3个map,第二个map统计是否已经对应过) 2.相同字母的处理方式*/#include #include #include #include #include using namespace std;int main(){ string s1, s2; while(cin >原创 2017-04-13 17:21:57 · 387 阅读 · 0 评论 -
codeforce 3A
The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t.原创 2017-05-24 10:26:28 · 428 阅读 · 0 评论 -
hdu5494
//题意:给你两个串,求最长公共子序列,但有个规则两个串在你求最长子序列的过程是可以移动元素位置的,但两个串相同下标的元素在移动的时候始终下标一致,也就是a[0]下标由0变为3的话b[0]的下标也由0变为3.//思路:其实这么想来此题并不是一道真正意义上的lcs,做法是若任意给一个a的序列 1、3、5、2、4任意给一个对应的b的序列3、4、2、5、1 则 1、3、5、2、4 ==》 1、3、...原创 2018-03-28 21:16:19 · 231 阅读 · 0 评论 -
hdu1243
//题意:给定一行字符串每个字符有自己对应的得分,然后接下来的两个串让你求出最长公共子序列的变形,什么变形呢,就是在泥鳅最长公共子序列的时候每次是给长度+1,而这里不是+1是加上相应的字符代表的分数,求的最高分数//思路:利用求最长公共子序列的方式将最后+1改为价对应的分数#include <cstdio>#include <iostream>#include <...原创 2018-03-28 15:56:11 · 200 阅读 · 0 评论 -
codeforces round # 412 c(数论)
You are an experienced Codeforces user. Today you found out that during your activity on Codeforces you have made y submissions, out of which x have been successful. Thus, your current success rate原创 2017-06-03 12:05:16 · 454 阅读 · 0 评论 -
codeforces round # 412B
Not so long ago the Codecraft-17 contest was held on Codeforces. The top 25 participants, and additionally random 25 participants out of those who got into top 500, will receive a Codeforces T-shirt.原创 2017-06-03 11:41:42 · 404 阅读 · 0 评论 -
poj3624(01背包模板)
/*基础dp*/#include #include #include #include #define maxx 100000+10 using namespace std;struct node{ int weight, value; }NN[maxx];int dp[maxx]; int main(){ int n, m; while(scanf("%d%d"原创 2016-11-30 17:35:54 · 574 阅读 · 0 评论 -
codeforce 4B(思维水题)
Tomorrow Peter has a Biology exam. He does not like this subject much, but d days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately,原创 2017-05-26 11:23:04 · 765 阅读 · 0 评论 -
codeforce3B
A group of tourists is going to kayak and catamaran tour. A rented lorry has arrived to the boat depot to take kayaks and catamarans to the point of departure. It's known that all kayaks are of the sa原创 2017-05-25 20:06:33 · 461 阅读 · 0 评论 -
codeforce 6A
Johnny has a younger sister Anne, who is very clever and smart. As she came home from the kindergarten, she told his brother about the task that her kindergartener asked her to solve. The task was jus原创 2017-05-24 23:02:31 · 466 阅读 · 0 评论 -
hdu5978(概率思维题)
A box contains black balls and a single red ball. Alice and Bob draw balls from this box without replacement, alternating after each draws until the red ball is drawn. The game is won by the player wh...原创 2017-05-14 16:08:57 · 771 阅读 · 2 评论 -
codeforce 805D(取模运算)
We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of substrings "ab" in the string and replace it with the string "bba". If we have no "ab原创 2017-05-12 22:20:47 · 460 阅读 · 0 评论 -
codeforces 754A(思维题)
One spring day on his way to university Lesha found an array A. Lesha likes to split arrays into several parts. This time Lesha decided to split the arrayA into several, possibly one, new arrays s原创 2017-05-14 11:44:21 · 599 阅读 · 0 评论 -
uva6698
/*题意是n个人上n天班,每个人必须早上和下午都上,给你一个时间t,要求求出n个人每个人上班时间减去t的总和最小*//*找到一个贪心策略即可,将两个数组按照升序降序排列即为最优解*/#include #include #include #include using namespace std;int m[600];int a[600];bool cmp1(const int原创 2017-04-28 10:22:46 · 367 阅读 · 0 评论 -
codeforce 2A
A. Winner time limit per test 1 second memory limit per test 64 megabytes input standard input output standard outputThe winner of the card game popular in Berland "Berlogging" is determined accor原创 2017-05-23 22:40:14 · 425 阅读 · 0 评论 -
hdu3723(卡特兰数组合数)
A delta wave is a high amplitude brain wave in humans with a frequency of 1 – 4 hertz which can be recorded with an electroencephalogram (EEG) and is usually associated with slow-wave sleep (SWS).原创 2017-05-11 21:47:53 · 730 阅读 · 0 评论
分享