水题训练
啦啦啦CS苦博士
一名活泼开朗的PhD Student
展开
-
HDU-OJ 2004 成绩转换
#include "stdio.h"int main (){ int score; while(scanf("%d",&score) != EOF){ score = score / 10; switch (score) { case 10: case 9:printf("A\n");break;原创 2018-01-21 21:40:55 · 207 阅读 · 0 评论 -
HDU-OJ 2003
求绝对值求实数的绝对值。Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 152087 Accepted Submission(s): 73892Problem Description 求实数的绝对值。Input 输入数据原创 2018-01-21 01:24:07 · 159 阅读 · 0 评论 -
HDU-2002 计算球体积
计算球体积计算球体积Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 183494 Accepted Submission(s): 72616Problem Description 根据输入的半径值,计算球的体积原创 2018-01-21 01:10:58 · 514 阅读 · 0 评论 -
HDU-2001题解分析
HDU-2001计算两点间的距离Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 241371 Accepted Submission(s): 83977Problem Description 输入两点坐标(X1,Y1),(X原创 2018-01-21 00:50:32 · 335 阅读 · 0 评论 -
HDU-杭电2000题解
题目要求Problem Description输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符Input输入数据有多组,每组占一行,有三个字符组成,之间无空格。Output对于每组输入数据,输出一行,字符中间用一个空格分开。Sample InputqweasdzxcSample Out原创 2018-01-21 00:13:32 · 629 阅读 · 0 评论 -
HDU-OJ 杭电1181 变形课——string写法
#include "iostream"#include "string"#include "vector"#include "stack" #include "cstring"#define already 1using namespace std;vectorstring> word;vectorint> a[10000];bool dps(int i ,int s原创 2018-01-26 22:58:57 · 265 阅读 · 0 评论 -
HDU-OJ 杭电 1176 免费馅饼
#include "stdio.h"#include "cstring"#include "algorithm"using namespace std;int dp[100005][20];int data[100005][20];//前者代表天数,后者代表每点的个数 int main(){ int n; int a, b; int max_day = 0; w原创 2018-01-26 13:55:44 · 266 阅读 · 0 评论 -
HDU-OJ 杭电2037 今年暑假不AC——Pair写法
#include "iostream"#include "algorithm"#include "cstring"#include "string" #include "vector"using namespace std;int comp(const pairint,int> &a, const pairint,int> &b){ return a.second < b.原创 2018-01-23 21:57:06 · 335 阅读 · 0 评论 -
ALDS1_5_A 大白P111页 组合之和
#include "iostream"#include "algorithm"#include "cstring"using namespace std;int dp[50][50];int a[50];int solve( int i, int target ,int n); int main(){ int n; int k; int count; int原创 2018-01-23 15:53:26 · 218 阅读 · 0 评论 -
HDU-OJ 1421 搬寝室
#include "iostream"#include "algorithm"#include "cstring"#define INF 99999999using namespace std;int comp(const void *a,const void *b);int dp[2005][1005] ;int main(){ int n, k; int w原创 2018-01-23 10:56:55 · 204 阅读 · 0 评论 -
HDU-OJ 2044 一只小蜜蜂
#include "iostream"using namespace std;long long path (int n);int main(){ int count; int a,b; cin >>count; while (cin>>a>>b && count--){ long long num1 = 1; long lon原创 2018-01-23 00:41:52 · 184 阅读 · 0 评论 -
逆波兰算法 C++——String及Stack实现
#include "cstdio"#include "iostream"#include "stack"#include "string"#include "sstream"using namespace std;stack<float> n;stack<string> f;int main(){ string s,buf; float a,b; float t原创 2018-01-22 21:29:40 · 561 阅读 · 0 评论 -
Uva 10474大理石在哪儿——Vector写法
#include "cstdio"#include "iostream" #include "algorithm"#include "vector"using namespace std;int main(){ int count; int num; int record; int kase = 1; int question; vect原创 2018-01-21 13:18:05 · 186 阅读 · 0 评论 -
UVa-10815
强烈安利Stringstream的使用 set的使用#include #include #include #include using namespace std;setstring> dict; //set会自动按排序好 int main(int argc, char** argv) {// freopen("data.in","r",stdin);//原创 2018-01-22 16:38:32 · 210 阅读 · 0 评论 -
蓝桥杯 算法训练 区间k大数查询
//问题描述//给定一个序列,每次询问序列中第l个数到第r个数中第K大的数是哪个。// 输入格式// 第一行包含一个数n,表示序列长度。// 第二行包含n个正整数,表示给定的序列。// 第三个包含一个正整数m,表示询问个数。// 接下来m行,每行三个数l,r,K,表示询问序列从左往右第l个数到第r个数中,从大往小第K大的数是哪个。序列元素从1开始标号。#include "stdio.h原创 2018-02-27 21:40:19 · 163 阅读 · 0 评论