codeforces
文章平均质量分 89
chudongfang2015
开心开心!!!!!!
展开
-
Educational Codeforces Round 34 题解
A. Hungry Student Problemtime limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Ivan’s classes at the university have just finished, and now he wan原创 2017-12-14 16:05:48 · 846 阅读 · 0 评论 -
Codeforces Round #395 (Div. 2) 题解
题目连接:http://codeforces.com/contest/764A. Taymyr is calling you解题思路:两个for循环,对一个数组进行操作,访问次数为2的数目为答案时间复杂度:O(n) 空间复杂度:O(n)代码如下:#include <iostream> #include <cstdio>#include <cstdlib>#include <cmath>#i原创 2017-02-03 21:43:56 · 350 阅读 · 0 评论 -
Codeforces Round #269 (Div. 2) D MUH and Cube Walls KMP
D. MUH and Cube Wallstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolar bears Menshykov and Uslada from原创 2017-02-06 10:01:13 · 350 阅读 · 0 评论 -
Codeforces Round #269 (Div. 2) C MUH and House of Cards 爆搜+剪枝
C. MUH and House of Cardstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolar bears Menshykov and Uslada f原创 2017-02-06 10:08:18 · 451 阅读 · 0 评论 -
CodeForces 500C New Year Book Reading 贪心
New Year is coming, and Jaehyun decided to read many books during 2015, unlike this year. He has n books numbered by integers from 1 to n. The weight of the i-th (1 ≤ i ≤ n) book is wi.As Jaehyun'原创 2017-01-15 16:15:40 · 472 阅读 · 0 评论 -
Codeforces 748B Santa Claus and Keyboard Check
B. Santa Claus and Keyboard Checktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSanta Claus decided to di原创 2017-01-10 20:24:19 · 702 阅读 · 0 评论 -
假期训练——THE DRUNK JAILER POJ - 1218 模拟
A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked. One night, the jailer gets bored and decides to play a game. Fo原创 2017-02-06 19:49:13 · 325 阅读 · 0 评论 -
Codeforces 749D Leaving Auction binary search+data structures
D. Leaving Auctiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n people taking part in auctio原创 2017-01-12 13:09:34 · 598 阅读 · 0 评论 -
Codeforces 754D Fedor and coupons binary search, data structures, greedy, sortings
D. Fedor and couponstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAll our characters have hobbies. The s原创 2017-01-12 13:14:16 · 450 阅读 · 0 评论 -
Codeforces 757B Bash's Big Day math, number theory
B. Bash's Big Daytime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputBash has set out on a journey to become t原创 2017-01-13 14:22:49 · 499 阅读 · 0 评论 -
Codeforces 757C Felicity is Coming! hashing, sortings, strings
C. Felicity is Coming!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt's that time of the year, Felicity原创 2017-01-13 14:20:52 · 791 阅读 · 0 评论 -
CodeForces 446B DZY Loves Modification 经典+贪心+更换遍历对象
As we know, DZY loves playing games. One day DZY decided to play with a n × m matrix. To be more precise, he decided to modify the matrix with exactly k operations.Each modification is one of the fo原创 2017-01-01 23:14:01 · 544 阅读 · 0 评论 -
CodeForces - 451B Sort the Array 简单模拟
Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of n distinct integers.Unfortunately, the size of a is too small. You want a bigger ar原创 2017-01-02 16:54:54 · 584 阅读 · 0 评论 -
CodeForces387C C - George and Number 贪心+递归
George is a cat, so he really likes to play. Most of all he likes to play with his array of positive integers b. During the game, George modifies the array by using special changes. Let's mark George'原创 2016-12-24 16:28:34 · 522 阅读 · 0 评论 -
CodeForces745B B - Hongcow Solves A Puzzle 暴力+判断
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters,原创 2016-12-24 16:25:05 · 554 阅读 · 0 评论 -
CodeForces745C C - Hongcow Builds A Nation 图论+容斥
Hongcow is ruler of the world. As ruler of the world, he wants to make it easier for people to travel by road within their own countries.The world can be modeled as an undirected graph with n nodes原创 2016-12-24 16:22:08 · 558 阅读 · 0 评论 -
CodeForces387B B - George and Round 贪心+暴力
George decided to prepare a Codesecrof round, so he has prepared m problems for the round. Let's number the problems with integers 1 through m. George estimates the i-th problem's complexity by inte原创 2016-12-24 16:31:46 · 507 阅读 · 0 评论 -
CodeForces 478C Table Decorations 思维题
You have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to some table shouldn't have the same color. What max原创 2016-12-31 16:30:29 · 653 阅读 · 0 评论 -
CodeForces 460BLittle Dima and Equation 方程项转换,降低方程项遍历范围
B. Little Dima and Equationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Dima misbehaved during a原创 2016-12-31 16:38:47 · 422 阅读 · 0 评论 -
Codeforces Round #398 (Div. 2) A. Snacktower 模拟
A. Snacktowertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAccording to an old legeng, a long time ago A原创 2017-02-18 21:28:51 · 932 阅读 · 0 评论 -
Codeforces Round #398 (Div. 2) B. The Queue brute force+greedy
B. The Queuetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFinally! Vasya have come of age and that means原创 2017-02-18 21:42:16 · 388 阅读 · 0 评论 -
Codeforces Round #272 (Div. 2) < math >
A Dreamoon and Stairs 数学水题题目思路:判断一下m的倍数的两倍是否大于n.代码#include <iostream> #include <cstdio>#include <cstdlib>#include <cmath>#include <iomanip>#include <algorithm>#include <climits>#include <cstring原创 2017-02-13 17:37:57 · 315 阅读 · 0 评论 -
Codeforces Round #394 (Div. 2) 题解
Codeforces Round #394 (Div. 2) 题解A. Dasha and Stairs解题思路:判断一下两者相减的绝度值是否为小于2。注意特判两个0的情况时间复杂度:O(1) 空间复杂度:O(1)代码如下:#include <iostream> #include <cstdio>#include <cstdlib>#include <cmath>#include <alg原创 2017-02-01 17:02:43 · 414 阅读 · 0 评论 -
Codeforces Round #397 题解
A. Neverending competitionstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputThere are literally dozens of s原创 2017-02-15 22:40:42 · 982 阅读 · 2 评论 -
Codeforces Round #402 (Div. 2) C. Dishonest Sellers 简单模拟
C. Dishonest Sellerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIgor found out discounts in a shop and原创 2017-03-15 12:52:24 · 506 阅读 · 0 评论 -
Codeforces Round #418 (Div. 2) 题解 ABC
A. An abandoned sentiment from pasttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA few years ago, Hitagi原创 2017-06-08 10:15:01 · 525 阅读 · 0 评论 -
Codeforces Round #429 (Div. 2) 题解
题目链接A Generous Kefa找字母出现的最大次数#include<iostream>#include<string>#include<vector>#include<algorithm>#include<queue>#include<cstdio>#include<cstring>#include<cmath>#include<map>#include<stack>#i原创 2017-08-19 09:50:35 · 612 阅读 · 0 评论 -
C - Restore Graph CodeForces - 404C BFS+小trick
Valera had an undirected connected graph without self-loops and multiple edges consisting of nvertices. The graph had an interesting property: there were at most k edges adjacent to each of its vert原创 2017-09-15 00:06:19 · 316 阅读 · 0 评论 -
Codeforces Round #438 题解
A. Bark to Unlock注意特判相等的情况#include<bits/stdc++.h>using namespace std;typedef long long ll;const int INF = 1e9;inline int read(){int ra,fh;char rx;rx=getchar(),ra=0,fh=1;while((rx<'0'||rx>'9')&&rx!原创 2017-10-05 21:27:36 · 221 阅读 · 0 评论 -
CodeForces 59D Team Arrangement 模拟
Recently personal training sessions have finished in the Berland State University Olympiad Programmer Training Centre. By the results of these training sessions teams are composed for the oncoming tea原创 2017-01-23 16:49:23 · 514 阅读 · 0 评论 -
CodeForces 59C Title 模拟+回文
Vasya has recently finished writing a book. Now he faces the problem of giving it the title. Vasya wants the title to be vague and mysterious for his book to be noticeable among others. That's why the原创 2017-01-23 16:46:56 · 603 阅读 · 0 评论 -
Codeforces Round #401 (Div. 2) 题解
A. Shell Gametime limit per test0.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBomboslav likes to look out of the window i原创 2017-02-28 15:19:23 · 455 阅读 · 0 评论 -
Codeforces Round #268 (Div. 2) 题解
A I Wanna Be the Guy解题思路直接用一个set,最后判断一下是否有n个数。#include <iostream> #include <cstdio>#include <cstdlib>#include <cmath>#include <iomanip>#include <algorithm>#include <climits>#include <cstring>#i原创 2017-02-10 14:03:36 · 296 阅读 · 0 评论 -
Codeforces Round #396 (Div. 2)题解
A Mahmoud and Longest Uncommon Subsequence解题思路整理:最长不相同串,思路很简单,如果两个串相同,则肯定不存在不相同串,如果两个串不相同,则取最长串的长度~解题代码:#include <iostream> #include <cstdio>#include <cstdlib>#include <cmath>#include <iomanip>#in原创 2017-02-10 14:16:13 · 367 阅读 · 0 评论 -
Codeforces 768A Oath of the Night's Watch
A. Oath of the Night's Watchtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output"Night gathers, and now my wat原创 2017-02-21 10:02:41 · 708 阅读 · 0 评论 -
Codeforces 768B Code For 1
B. Code For 1time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputJon fought bravely to rescue the wildlings wh原创 2017-02-21 10:06:24 · 563 阅读 · 0 评论 -
Codeforces 768C Jon Snow and his Favourite Number
C. Jon Snow and his Favourite Numbertime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputJon Snow now has to fi原创 2017-02-21 10:09:45 · 2067 阅读 · 0 评论 -
CodeForces 59A Word 水题
Vasya is very upset that many people on the Net mix uppercase and lowercase letters in one word. That's why he decided to invent an extension for his favorite browser that would change the letters' re原创 2017-01-23 16:43:31 · 1500 阅读 · 0 评论 -
CodeForces 59B Fortune Telling
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest on原创 2017-01-23 16:45:11 · 1234 阅读 · 0 评论 -
Codeforces 742C C. Arpa's loud Owf and Mehrdad's evil plan
C. Arpa's loud Owf and Mehrdad's evil plantime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs you have notic原创 2016-12-07 23:53:11 · 744 阅读 · 0 评论