水题
whiskey_wei
这个作者很懒,什么都没留下…
展开
-
第一次写博客,一道水题,string game
D. String Game time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Little Nastya has a hobby, she likes to remove原创 2017-03-08 21:44:16 · 246 阅读 · 0 评论 -
cf434A. Did you mean...
题目 水题。。。 #include #include #include using namespace std; char a[3010]; bool f(char x) { if(x=='a'||x=='e'||x=='i'||x=='o'||x=='u') return 1; else return 0; } int原创 2017-09-20 20:29:03 · 395 阅读 · 0 评论 -
cf434 div.2 A. k-rounding
原题 求n和10^k的最小公倍数; n*10^k/gcd(n,10^k); #include using namespace std; long long gcd(long x,long y) { return (y==0)?x:gcd(y,x%y); } int main() { long long n; int k; scanf("%l原创 2017-09-23 11:31:56 · 259 阅读 · 0 评论 -
Least Common Multiple
题目:求一组数的最小公倍数 #include #include #include using namespace std; int gcd(int x,int y) { int temp; if(y>x) { temp=x; x=y; y=temp; } if(y==0) return x;原创 2017-07-27 09:31:43 · 176 阅读 · 0 评论 -
poj1979-dfs
dfs的入门题,水~。。。(注意判断条件就行了) #include #include #include using namespace std; char ma[25][25]; bool vis[25][25]; int dx[4]={-1,0,1,0}; int dy[4]={0,1,0,-1}; int m,n; int cnt; void dfs(int x,int y) { i原创 2017-07-19 20:55:08 · 182 阅读 · 0 评论 -
小希的迷宫
看到这个题一开始想到并查集,仔细想了下,其实可以直接统计点数和边数,再作比较,就直接出来了 #include #include #include using namespace std; int main() { bool vis[100005]; int a,b; int cnt1=0,cnt2=0; memset(vis,0,sizeof(vi原创 2017-07-20 13:02:47 · 160 阅读 · 0 评论 -
并查集_hdu1213
How Many Tables http://acm.hdu.edu.cn/showproblem.php?pid=1213 Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how man原创 2017-04-12 18:59:47 · 2961 阅读 · 1 评论 -
find q hdu
Find Q Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others) Total Submission(s): 319 Accepted Submission(s): 181 Problem Description Byteasar is addicted to原创 2017-03-15 18:01:23 · 311 阅读 · 0 评论 -
D - Fxx and string
Problem Description Young theoretical computer scientist Fxx get a string which contains lowercase letters only. The string S contains n lowercase letters S1S2…Sn.Now Fxx wants to know how m原创 2017-03-14 22:14:54 · 230 阅读 · 0 评论 -
Lotus and Characters
Lotus and Characters Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others) Total Submission(s): 570 Accepted Submission(s): 213 Problem Description Lotus h原创 2017-03-13 21:27:56 · 248 阅读 · 0 评论 -
Kblack loves flag hdu
Kblack loves flags, so he has infinite flags in his pocket. One day, Kblack is given an n∗m n∗m chessboard and he decides to plant flags on the chessboard where the position of each flag is desc原创 2017-03-14 17:22:23 · 262 阅读 · 0 评论 -
Skip the Class hdu AB
原文: http://acm.split.hdu.edu.cn/showproblem.PHP?pid=6015 翻译: 问题描述 终于又开学啦。呃喵最喜欢的就是开学了,因为这样她又可以愉快地翘课了(啊?) 呃喵接下来有n节课程需要上(换句话说,可以翘。) 每节课程有相应的课程类型与课程翘课价值。 有一点需要注意的是,呃喵不可以翘同一类课程超过两次,就是如果这类课已经翘了两次原创 2017-03-12 22:49:22 · 301 阅读 · 0 评论 -
划分子集问题
问题描述:已知集合A={a1,a2,……an},及集合上的关系R={ (ai,aj) | ai,ajA, ij},其中(ai,aj)表示ai与aj间存在冲突关系。要求将A划分成互不相交的子集A1,A2,……Ak,(kn),使任何子集中的元素均无冲突关系,同时要求分子集个数尽可能少。 思路:先构造一个队列,将A中元素进队,然后依次取出元素放入一个待分配的组中,若当前元素与改组中已经入选的元素...原创 2018-10-25 00:01:02 · 4201 阅读 · 0 评论