bzoj2878 [NOI2012] 迷失游乐园 期望+基环树dp 题目描述放假了,小Z觉得呆在家里特别无聊,于是决定一个人去游乐园玩。进入游乐园后,小Z看了看游乐园的地图,发现可以将游乐园抽象成有n个景点、m条道路的无向连通图,且该图中至多有一个环(即m只可能等于n或者n-1)。小Z现在所在的大门也正好是一个景点。小Z不知道什么好玩,于是他决定,从当前位置出发,每次随机去一个和当前景点有道路相连的景点,并且同一个景点不去两次(包括起始景点)。贪玩的小Z会一直游玩...
[NOIp2016] 蚯蚓 题目描述本题中,我们将用符号 \lfloor c \rfloor⌊c⌋ 表示对c向下取整,例如: \lfloor 3.0 \rfloor= \lfloor 3.1 \rfloor=\lfloor 3.9 \rfloor=3⌊3.0⌋=⌊3.1⌋=⌊3.9⌋=3 。蛐蛐国最近蚯蚓成灾了!隔壁跳蚤国的跳蚤也拿蚯蚓们没办法,蛐蛐国王只好去请神刀手来帮他们消灭蚯蚓。蛐蛐国里现在共有n只蚯蚓(n为正整数)。...
SNOI2018 暴力记 DAY-1:下午中考体考,早上就没去机房,十点才起的床,中午考试前和班里同学谈笑风生了一会,结果都奶我进队,之后体考也凉凉的,50m起跑慢了,1000m没安排好时间,实心球离满分差的贼远,最后47分滚粗,班里绝大多数人都49。DAY0:省选前一天,敲了一天模板,还打了三道SA题,已经为我省选翻车做好了铺垫。晚上机房人几乎都走完了,我一天也没打几个模板,感觉真的要凉了,就再也没管了颓圮去了,打了五局...
bzoj5017 [Snoi2017]炸弹 O(n)递推 5017: [Snoi2017]炸弹Time Limit: 30 Sec Memory Limit: 512 MBSubmit: 320 Solved: 118[Submit][Status][Discuss]Description在一条直线上有 N 个炸弹,每个炸弹的坐标是 Xi,爆炸半径是 Ri,当一个炸弹爆炸时,如果另一个炸弹所在位置 Xj 满足: Xi−Ri≤Xj≤Xi+Ri,那么,该...
bzoj5248 [2018多省省队联测]一双木棋 5248: [2018多省省队联测]一双木棋Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 155 Solved: 132[Submit][Status][Discuss]Description菲菲和牛牛在一块n行m列的棋盘上下棋,菲菲执黑棋先手,牛牛执白棋后手。棋局开始时,棋盘上没有任何棋子,两人轮流在格子上落子,直到填满棋盘时结束。落子的规则是...
codeforces 895d string mark D. String Marktime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAt the Byteland State University marks are strings of the same length. Mark x is con...
codeforces895c Square Subsets C. Square Subsetstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya was late for the lesson too. The teacher gave him an additional task. For s...
codeforces900D Unusual Sequences D. Unusual Sequencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputCount the number of distinct sequences a1, a2, ..., an (1 ≤ ai) consisting of p...
codeforces920G List Of Integers G. List Of Integerstime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet's denote as L(x, p) an infinite sequence of integers y such that gcd(p, y) ...
codeforces 908E New Year and Entity Enumeration E. New Year and Entity Enumerationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an integer m.Let M = 2m - 1.You are also given a s...
codeforces 932e Team Work E. Team Worktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have a team of N people. For a particular task, you can pick any non-empty subset ...
codeforces 938e Max History E. Max Historytime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a of length n. We define fa the following way:Initially fa = ...
codeforces 486d Valid Sets D. Valid Setstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs you know, an undirected connected graph with n nodes and n - 1 edges is called a tr...
codeforces 850b Arpa and a list of numbers B. Arpa and a list of numberstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputArpa has found a list containing n numbers. He calls a list bad if an...
codeforces789D Weird journey D. Weird journeytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle boy Igor wants to become a traveller. At first, he decided to visit all the...
codeforces 893e Counting Arrays E. Counting Arraystime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two positive integer numbers x and y. An array F is called an y-fa...
codeforces888G Xor-MST G. Xor-MSTtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a complete undirected graph with n vertices. A number ai is assigned to ea...
codeforces 888D Almost Identity Permutations D. Almost Identity Permutationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA permutation p of size n is an array such that every integer from ...
codeforces859E Desk Disorder E. Desk Disordertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA new set of desks just arrived, and it's about time! Things were getting quite cr...
codeforces869c The Intriguing Obsession C. The Intriguing Obsessiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output— This is not playing but duty as allies of justice, Nii-chan!— Not alli...