P's Blog

  • Home

  • About

  • Tags

  • Categories

  • Archives

  • Search

蚂蚁感冒

Posted on 2019-03-22 | Edited on 2019-06-12 | In 蓝桥杯 | Views:

题意

长100厘米的细长直杆子上有n只蚂蚁。它们的头有的朝左,有的朝右。
每只蚂蚁都只能沿着杆子向前爬,速度是1厘米/秒。
当两只蚂蚁碰面时,它们会同时掉头往相反的方向爬行。
这些蚂蚁中,有1只蚂蚁感冒了。并且在和其它蚂蚁碰面时,会把感冒传染给碰到的蚂蚁。
请你计算,当所有蚂蚁都爬离杆子时,有多少只蚂蚁患上了感冒。

Read more »

CF-11

Posted on 2019-03-22 | Edited on 2019-09-20 | In cf | Views:

D. A Simple Task

题意

求出一个n个点m个边的图,求简单环有多少(没有重复点和边)。(n<20)

Read more »

HDU-4651

Posted on 2019-03-22 | Edited on 2019-05-10 | In hdu | Views:

题意

整数拆分,$(1\le n\le 10^5)$

Read more »

杂题

Posted on 2019-03-22 | Edited on 2019-09-20 | In 其他 | Views:

1

题意

将整数n拆分为m个数的和,输出这m个数or的最小值。

Read more »

HDU-4055 Number String

Posted on 2019-03-22 | Edited on 2019-04-01 | In hdu | Views:

题意

给你一个字符串s,s[i] = ‘D’表示排列中a[i] > a[i+1],s[i] = ‘I’表示排列中a[i] < a[i+1]。

比如排列 {3, 1, 2, 7, 4, 6, 5} 表示为字符串 DIIDID。

Read more »

LightOJ-1197 Help Hanzo

Posted on 2019-03-22 | Edited on 2019-10-04 | In lightoj | Views:

题意

求 $a\sim b$ 间素数个数 $(1 \le a \le b < 2^{31}, b - a \le 1e5)$

Read more »

POJ-3167 Cow Patterns

Posted on 2019-03-22 | Edited on 2019-06-17 | In poj | Views:

题意

一个农场主有 N 头牛,每个牛都以它身上的斑点数作为标志,以斑点数作为标准对牛进行 rank 排序,定义牛的序列的相同性为第 i 头牛及其之前的牛的比他 rank 小的数量和与他 rank 相同的数量,比如:
1 4 4 3 2 1 和 2 10 10 7 3 2 是一样的模式串
要求数有多少个符合要求的模式串,并输出每个符合要求的子串的起始位置。

Read more »

CF-675

Posted on 2019-03-22 | Edited on 2019-09-20 | In cf | Views:

C. Money Transfers

题意

有n家银行围成一个圈,有个人在有些银行里欠了钱,在一些银行里有存钱,欠的钱总数等于存的钱总数。现在可以有操作,如果两个银行相邻,那么就能在一个银行转任意多的钱到另一个银行。问最少的操作次数,使得在所有银行的存款钱数都为0。

Read more »

HDU-5970 最大公约数

Posted on 2019-03-22 | Edited on 2019-04-01 | In hdu | Views:

题意

给一个函数

1
2
3
4
5
6
7
8
9
10
int f(int x,int y){
int c=0;
while(y>0){
c++;
t=x%y;
x=y;
y=t;
}
return c*x*x;
}

给出n,m,p,求$\Large\sum\limits_{i=1}^n\sum\limits_{j=1}^m\lfloor\frac {i*j} {f(i,j)}\rfloor$

Read more »

POJ-1050 To the Max

Posted on 2019-03-21 | Edited on 2019-04-01 | In poj | Views:

题意

求最大子矩阵和。

Read more »
1…6789
PerpEternal

PerpEternal

81 posts
12 categories
27 tags
Links
  • GuYF's Blog
© 2019 PerpEternal