海绵的博客

竞赛虐我千百遍,我待竞赛如初恋。 Never Give Up!!!

#1450 : Inside Triangle

描述 Determine if a point is inside a 2D triangle. 输入 The first line contains an integer T denoting the number of test case. (1 <= T &...

2018-10-31 15:13:30

阅读数:11

评论数:0

蓝魔法师

链接:https://www.nowcoder.com/acm/contest/215/C 来源:牛客网   题目描述 “你,你认错人了。我真的,真的不是食人魔。”--蓝魔法师   给出一棵树,求有多少种删边方案,使得删后的图每个连通块大小小于等于k,两种方案不同当且仅当存在一条边在一个方...

2018-10-30 20:04:17

阅读数:13

评论数:0

String HDU - 4821

Given a string S and two integers L and M, we consider a substring of S as “recoverable” if and only if   (i) It is of length M*L;   (ii) It can be c...

2018-10-29 15:28:57

阅读数:13

评论数:0

2018-ICPC沈阳站总结

Day0:       这次比赛是坐飞机去的,还是很兴奋的,一路上觉得都很新鲜,东航还给吃的,飞机是真的舒服,还特别快。我们周五上午就到了,一开始去了一个高级的如家酒店,一会才发现,自己定的不是这家,我说怎么这么好。然后中午吃了个旋转火锅,特别难吃, 下午回到宾馆,抓紧刷了两道题, 到了晚上,想...

2018-10-24 14:49:17

阅读数:77

评论数:0

七彩线段

链接:https://www.nowcoder.com/acm/contest/212/C 来源:牛客网   题目描述 听说彩虹有七种颜色? 一维坐标轴上n条线段,每条线段左端点l,右端点r,颜色为c,从中选m种颜色的互不接触的线段,每种颜色可选多条,所选线段的总长度最长为多少? 输入描述:...

2018-10-23 16:12:50

阅读数:8

评论数:0

冥土追魂

链接:https://www.nowcoder.com/acm/contest/212/B 来源:牛客网   题目描述 有一天 Misaka 和 Kuroko 在玩一个关于冥土追魂的游戏.... Misaka和Kuroko在一个 n x m 的棋盘上玩游戏,每个格子上都放着一些呱太。游戏共进行...

2018-10-17 11:24:51

阅读数:18

评论数:0

Push Button II (计数)

描述 There are N buttons on the console. Each button needs to be pushed exactly once. Each time you may push several buttons simultaneously. Assume t...

2018-10-16 16:41:28

阅读数:6

评论数:0

Frogs HDU - 5514

There are m stones lying on a circle, and n frogs are jumping over them. The stones are numbered from 0 to m−1 and the frogs are numbered from 1 to n...

2018-10-16 13:22:08

阅读数:22

评论数:0

Pangu and Stones HihoCoder - 1636

In Chinese mythology, Pangu is the first living being and the creator of the sky and the earth. He woke up from an egg and split the egg into two par...

2018-10-16 13:14:45

阅读数:10

评论数:0

Master of Phi HDU - 6265 (推公式)

推公式: 1. 把   再往下拆一级,拆到 一级, 复杂度 ,但是得用 实现,要是二进制枚举会重算很多数字 2. 直接 积性函数的 性质, 直接把 拆掉,最后把所有的相乘   第一种 #include<bits/stdc++.h> u...

2018-10-12 16:29:00

阅读数:23

评论数:0

Recursive sequence HDU - 5950 (快速幂注意事项)

Farmer John likes to play mathematics games with his N cows. Recently, they are attracted by recursive sequences. In each turn, the cows would stand ...

2018-10-11 11:05:07

阅读数:21

评论数:0

Vertex Cover CodeChef - VRTXCOVR

You are given an undirected graph G = (V, E) containing N nodes and M edges. The nodes are numbered from 1 to N. A subset C of V is a vertex cover if...

2018-10-11 09:37:21

阅读数:36

评论数:0

poj 3207 Ikki's Story IV - Panda's Trick

Description liympanda, one of Ikki’s friend, likes playing games with Ikki. Today after minesweeping with Ikki and winning so many times, he is tire...

2018-10-09 20:32:39

阅读数:21

评论数:0

Area of an amazing figure CodeChef - AREAFIGR

There is an equilateral triangle ABC with side length 2*a. The coordinates of the triangle's vertices are A = (-a, 0), B = (a, 0) and C = (0, sqrt(3)...

2018-10-09 16:16:53

阅读数:22

评论数:0

Poor Warehouse Keeper HDU - 4803 (卡精度)

Jenny is a warehouse keeper. He writes down the entry records everyday. The record is shown on a screen, as follow: There are only two buttons on...

2018-10-06 22:11:33

阅读数:16

评论数:0

Rebuild hdu-5531 (精度)

Archaeologists find ruins of Ancient ACM Civilization, and they want to rebuild it. The ruins form a closed path on an x-y plane, which has n endpoin...

2018-10-06 21:35:32

阅读数:21

评论数:0

C. 痛苦的 01 矩阵 (推公式,树状数组维护)

现有一个 n×n 的 01 矩阵 M。 定义 cost(i,j) 为:把第 i 行和第 j 列全部变成 1 最少需要改动多少个元素。 定义矩阵的痛苦值 pain(M) 为:   pain(M)=(∑i=1n∑j=1n(cost(i,j))2)mod(109+7) 要求求出初始矩阵的痛苦值...

2018-10-06 16:53:37

阅读数:26

评论数:0

D. Social Circles

You invited n guests to dinner! You plan to arrange one or more circles of chairs. Each chair is going to be either occupied by one guest, or be emp...

2018-10-06 15:20:02

阅读数:57

评论数:0

Count a * b HDU - 5528 (推公式)

Marry likes to count the number of ways to choose two non-negative integers a and b less than m to make a×b mod m≠0. Let's denote f(m) as the number ...

2018-10-06 14:16:09

阅读数:24

评论数:0

Jumping frog Gym - 101889J

思维题: 一种方案可行,那么 肯定是可行的,然后验证就好了。 启示: 貌似超时,实际上,只需要验证 n 的因子就行了,根本就不多。 下次看见gcd(),想想因子,就会很舒服。 #include<bits/stdc++.h> using nam...

2018-10-04 20:23:24

阅读数:35

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭