
ACM
roadkiller.
我愿浪漫至死
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU - 1264 Counting Squares
Your input is a series of rectangles, one per line. Each rectangle is specified as two points(X,Y) that specify the opposite corners of a rectangle. All coordinates will be integers in the range 0 to ...原创 2019-02-21 15:44:10 · 189 阅读 · 0 评论 -
HDU - 1199 Color the Ball (离散化入门题)
There are infinite balls in a line (numbered 1 2 3 ....), and initially all of them are paint black. Now Jim use a brush paint the balls, every time give two integers a b and follow by a char 'w' o...翻译 2019-05-14 21:41:43 · 352 阅读 · 0 评论 -
金色传说 ( 递推打表+规律+思维 ) Gym - 102174J
龙老师获得了一个不寻常的计算器,因为这个道具的品质是金色传说。它除了在按 666 时可以发出声音以外,还可以输入一个算式并计算出它的结果。金色传说计算器的显示屏上只有 n 个可以显示的位置,而且只有 0⋯9 十个数字键和两个运算符键+、-共 12 个按键可以按,连=都没有,所以必须输入一个 n位的合法算式,它才会自动计算出该算式的结果。我们定义合法的算式为一个长度恰好为 n的字符串,其中字符串...原创 2019-05-03 10:58:52 · 303 阅读 · 0 评论 -
Welcome Party ZOJ - 4109 (前向星建图+并查集+BFS)
The 44th World Finals of the International Collegiate Programming Contest (ICPC 2020) will be held in Moscow, Russia. To celebrate this annual event for the best competitive programmers around the ...原创 2019-04-30 18:15:17 · 158 阅读 · 0 评论 -
小D的一串数字 (数位DP做法)
Problem Description小D在纸上随便写了两串数字,“23333333”,“0123456789”。第一个串中含有7个重复的相邻的数字,第二个串中不含相邻的重复的数字。小D喜欢第一类串,但是他放低了要求,只要一串数字中含有超过两个重复的相邻的数字,小D就喜欢这串数字。现在他想知道,长度为n的的所有数字串,最多有多少个串会被他喜欢?但是小D是个数学白痴,麻烦你帮他解决这个问题...原创 2019-05-03 20:07:28 · 610 阅读 · 0 评论 -
Beauty of Array(思维)
Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the beauty of all contiguous ...原创 2019-04-03 10:45:45 · 132 阅读 · 0 评论 -
Triangles (海伦公式)
#include<iostream>#include<cmath>using namespace std;double qiu(int a,int b,int c,int d){ return sqrt((c-a)*(c-a)+(d-b)*(d-b));}double hai(int x1,int y1,int x2,int y2,int x3,int...原创 2019-04-13 17:04:33 · 315 阅读 · 0 评论 -
Kotlin Island (简单思维题)
本来没打算写这篇博客的,但是觉得这道题敲起来还是得想一想的,就来写写本来觉得这题特别简单,几分钟就推出来规律了,但是却怎么写都写不对,还浪费了大半个小时,很想和队友说声对不起#include<bits/stdc++.h>using namespace std;char a[105][105];int main(){ freopen("kotlin.in",...原创 2019-05-07 23:56:10 · 295 阅读 · 0 评论 -
小字辈(BFS)
#include<bits/stdc++.h>using namespace std;vector<int>v[100005];//存关系vector<int>p[100005];//存每一辈的人int main(){ int n,m; cin>>n; for(int i=1;i<=n;i++) ...原创 2019-03-20 17:34:35 · 238 阅读 · 0 评论 -
小希的迷宫
小希的迷宫上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,...原创 2019-02-17 15:23:01 · 202 阅读 · 0 评论 -
Catch That Cow
Problem DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is ...原创 2019-02-17 14:12:19 · 199 阅读 · 0 评论 -
Pots(BFS)
注释部分为如果题目要求要输出每步操作的话所需要的内容。Problem DescriptionYou are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the po...原创 2019-02-17 14:09:34 · 206 阅读 · 0 评论 -
Wormholes POJ
WormholesWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination a...原创 2019-01-27 22:07:17 · 115 阅读 · 0 评论 -
Candies(差分约束) POJ
CandiesDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute the...原创 2019-01-27 12:53:16 · 328 阅读 · 0 评论 -
Oil Deposits(水题)
Oil DepositsThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a ...原创 2019-01-22 09:59:17 · 196 阅读 · 0 评论 -
ACM初级Java基本运算
初学,写一下最基本的四则运算以及幂运算和模运算叭,大佬发现有误可以指正,(*^__^*)import java.math.*;import java.util.*;public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in);//C++写习惯了a...原创 2019-05-06 17:40:13 · 160 阅读 · 0 评论 -
A Tale of Two Lands (二分答案) Codeforces Round #561 (Div. 2)
The legend of the foundation of Vectorland talks of two integers原创 2019-05-20 17:51:52 · 447 阅读 · 1 评论 -
不要62(数位DP)
杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉利数字之列...原创 2019-04-28 11:39:57 · 175 阅读 · 0 评论 -
Bicolored RBS (栈)(水题)(凌晨不适合做题QAQ)
A string is called bracket sequence if it does not contain any characters other than "(" and ")". A bracket sequence is called regular (shortly, RBS) if it is possible to obtain correct arithmetic exp...原创 2019-05-16 19:43:49 · 281 阅读 · 0 评论 -
悄悄关注——map做简单些
悄悄关注新浪微博上有个“悄悄关注”,一个用户悄悄关注的人,不出现在这个用户的关注列表上,但系统会推送其悄悄关注的人发表的微博给该用户。现在我们来做一回网络侦探,根据某人的关注列表和其对其他用户的点赞情况,扒出有可能被其悄悄关注的人。输入格式:输入首先在第一行给出某用户的关注列表,格式如下:人数N 用户1 用户2 …… 用户N其中N是不超过5000的正整数,每个用户i(i=...原创 2019-03-28 19:45:13 · 745 阅读 · 1 评论 -
水果——map自排序
map是个很玄学的东西水果夏天来了~~好开心啊,呵呵,好多好多水果~~Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了.Input第一行正整数N(0<N<=10)表示有N组测试数据.每组测试数据的第一行是一个整数M(0<M<=100),表示工有M次成...原创 2019-03-27 11:10:10 · 199 阅读 · 0 评论 -
学到了——vector排序
注意要设置C++11编译器才可以编译auto it#include<iostream>#include<vector>#include<algorithm>using namespace std;int main(){ vector<int> a; int n = 5; while (n--) { ...原创 2019-03-27 10:57:01 · 239 阅读 · 0 评论 -
学到了——istringstream 的用法
听XB大佬分享这个东西,发现处理某些题还是很有用的它能够自动分割字符串#include<bits/stdc++.h>using namespace std;int main(){ string str="I am a boy"; istringstream is(str); string s; while(is>>s) ...原创 2019-03-27 10:24:12 · 893 阅读 · 0 评论 -
PTA 图着色问题(邻接表+set)
图着色问题是一个著名的NP完全问题。给定无向图G=(V,E),问可否用K种颜色为V中的每一个顶点分配一种颜色,使得不会有两个相邻顶点具有同一种颜色?但本题并不是要你解决这个着色问题,而是对给定的一种颜色分配,请你判断这是否是图着色问题的一个解。输入格式:输入在第一行给出3个整数V(0<V≤500)、E(≥0)和K(0<K≤V),分别是无向图的顶点数、边数、以及颜色数。...原创 2019-03-26 17:26:36 · 837 阅读 · 0 评论 -
HDU - 1263 水果(map)
夏天来了~~好开心啊,呵呵,好多好多水果~~Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了.Input第一行正整数N(0<N<=10)表示有N组测试数据.每组测试数据的第一行是一个整数M(0<M<=100),表示工有M次成功的交易.其后有M行数据,每行表示...原创 2019-02-21 17:08:24 · 141 阅读 · 0 评论 -
C++标准库string与常见数据类型的相互转换
从其他博客学到的,自己又拓展了一下参考博文:https://blog.youkuaiyun.com/na_beginning/article/details/53576123https://blog.youkuaiyun.com/lanzhihui_10086/article/details/39995869正题开始:一、string转long long , int , double预备知识at...原创 2019-05-26 10:40:15 · 420 阅读 · 0 评论 -
【FJOI2007】【BZOJ1002】轮状病毒 (找规律)(矩阵快速幂)
将NN个点排列成一个圆形,中间放置一个点固定为根节点,问特殊生成树的种类数。特殊生成树:除根节点以外,其他节点只能与自己左右节点相连,或与根节点相连。p.s.若节点的左右节点为同一个节点,向左或向右连接视为不同的生成树。由于种类数可能过大,对1,000,000,0071,000,000,007取模。当N=3N=3时,所有生成树表示如下:Input多组数据,请输入要...原创 2019-02-22 23:32:15 · 262 阅读 · 0 评论 -
Border
Astronaut Natasha arrived on Mars. She knows that the Martians are very poor aliens. To ensure a better life for the Mars citizens, their emperor decided to take tax from every tourist who visited the...原创 2019-02-21 16:43:04 · 153 阅读 · 0 评论 -
Sasha and Array (线段树+矩阵快速幂)
Sasha has an array of integers a1, a2, ..., an. You have to perform m queries. There might be queries of two types:1 l r x— increase all integers on the segment from l to r by values x; 2 l r—...原创 2019-02-21 15:38:31 · 309 阅读 · 0 评论 -
【数论】【模板】快速幂、快速乘法以及矩阵乘法、矩阵快速幂
普通快速幂:ll quick_mod(ll a,int n){ ll sum=1;//注意是乘法,所以初始化为1 while(n) { if(n&1)//&运算符表示取这个数二进制的最后一位 { sum=sum*a%mod;//若这位为1那么总和就应该乘当前的a } ...原创 2019-02-20 09:03:12 · 332 阅读 · 0 评论 -
Sequences Gym - 101020D (典型DP)
没想到我会卡到这道dp题上dp还是刷的太弱了啊,得加强One of the most wonderful qualities of an ACMer is to be multi interests so he combines multiple qualifications and hobbies not just coding. Hussain is one of the mos...原创 2019-04-03 23:41:54 · 272 阅读 · 1 评论 -
ZOJ - 4120 Tokens on the Segments 第十届山东ACM省赛H题
Consider segments on a two-dimensional plane, where the endpoints of the -th segment are and . One can put as many tokens as he likes on the integer points of the plane (recall that an integer poin...原创 2019-05-14 20:20:46 · 568 阅读 · 0 评论 -
过山车 HDU - 2063 匈牙利算法
以前没接触过这个匈牙利算法,发现原理还是很容易懂的这个人把原理讲的生动形象:https://blog.youkuaiyun.com/dark_scope/article/details/8880547RPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有...原创 2019-03-13 11:47:13 · 154 阅读 · 0 评论 -
Friends HDU - 5241(Java)
今天向 java dl lsl 学习了一波Javatql学会Java简单操作了好开森窝上题:Mike has many friends. Here are nine of them: Alice, Bob, Carol, Dave, Eve, Frank, Gloria, Henry and Irene.Mike is so skillful that he can maste...原创 2019-05-06 17:25:04 · 182 阅读 · 0 评论