Codeforces
文章平均质量分 80
童话ing
心之所向,道之所存。
展开
-
Codeforces(767A)
A. Snacktowertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAccording to an old legeng, a long time ago A原创 2017-02-19 09:04:22 · 729 阅读 · 0 评论 -
codeforces 822A(java水水)
题目链接:http://codeforces.com/problemset/problem/822/A题意:两数阶乘的近似gcd(最大公约数)思路:没有说近似估计多少,那么答案其实就是最小那个数的阶乘import java.util.*;import java.io.*;import java.math.*;public class Main{ public stati原创 2017-07-20 15:44:33 · 324 阅读 · 0 评论 -
codeforces822B
题目链接:http://codeforces.com/contest/822/problem/B题意:给你两个串s,t,在串t中找与s相同字母最多的串。输出s需要改变字母总数以及他们的位置,下标从1开始。思路:1000数据,暴力寻找相同最多的即可。当然也可以直接找寻不相同最少的,都一样。(代码写的很难看,不建议参考)#includebits/stdc++.h>using namesp原创 2017-07-20 15:55:35 · 313 阅读 · 0 评论 -
codeforces822C(排序+贪心)
题目链接:http://codeforces.com/problemset/problem/822/C题意:n各区间,每个区间都有一个值cost,可能有相交,给出一个总时间x,选取每个区间[L,R]花费时间为R-L+1;问是否能选取某些不相交区间使得花费总时间为x。如果能,要求值cost总和最小。思路:对于l从小到大排序,将r放进优先队列从小到大排序。代码:#includebi原创 2017-07-20 16:08:03 · 377 阅读 · 0 评论 -
codeforces 832B
B. Petya and Examtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt's hard times now. Today Petya needs to原创 2017-07-26 15:08:43 · 463 阅读 · 0 评论 -
codeforces 837A
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a text of single-space separated words, consisting of small原创 2017-08-13 19:37:22 · 426 阅读 · 0 评论 -
codeforces845C(stl)
C. Two TVstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp is a great fan of television.He wrote down all原创 2017-08-30 20:54:43 · 371 阅读 · 0 评论 -
codeforces849A
A. Odds and Endstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhere do odds begin, and where do they end? Where doe原创 2017-09-02 10:48:53 · 355 阅读 · 0 评论 -
codeforces 849B
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputConnect the countless points with lines, till we reach the faraway yonder原创 2017-09-02 10:59:30 · 233 阅读 · 0 评论 -
codeforces849C
memory limit per test256 megabytesinputstandard inputoutputstandard outputFrom beginning till end, this message has been waiting to be conveyed.For a given unordered multiset of原创 2017-09-02 11:05:07 · 391 阅读 · 0 评论 -
Codeforces913A(小思维)
A. Modular Exponentiationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe following problem is well-know原创 2018-01-22 20:08:38 · 226 阅读 · 0 评论 -
codeforces976A(水题)
题目链接:http://codeforces.com/contest/976/problem/A题目:memory limit per test256 megabytesinputstandard inputoutputstandard outputString can be called correct if it consists of characters "0" and "1" an...原创 2018-05-06 18:54:21 · 407 阅读 · 0 评论 -
codeforces976C(排序+贪心)
题目链接:http://codeforces.com/contest/976/problem/C题意:给出一些区间,让你找出使得li>=lj&&ri<=rj的i j,有多组解输出任意一组即可,没有输出-1,-1思路:按照l小到大排个序,相等r大到小排个序,挨着找就可以了。代码:#include<bits/stdc++.h>using namespace s...原创 2018-05-06 19:11:59 · 359 阅读 · 0 评论 -
codeforces988C(map简单运用)
题目链接:http://codeforces.com/problemset/problem/988/C题意:给你k个长度为n[i]的序列,让你每个序列去掉一个数判断这n个序列中是否有两个和相等的序列,如果有,输出其中两个序列的编号以及他们去掉数字在相应序列的位置。思路:对于每个序列直接累加和,然后用一个map记录序列的id,一个map记录序列和,标记那些和出现过,如果已经出现过了并且不再同一个序列...原创 2018-06-18 20:46:07 · 487 阅读 · 0 评论 -
codeforces570A-D题解
A. Nearest Interesting Number题目链接:http://codeforces.com/problemset/problem/1183/A题意:找到一个距离n最近并且不小于n的各个数位和%4==0的数。思路:直接暴力即可。AC代码:#include<bits/stdc++.h>using namespace std;int der(in...原创 2019-08-19 11:48:29 · 211 阅读 · 0 评论 -
codeforces821 C(栈操作)
C. Okabe and Boxestime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOkabe and Super Hacker Daru are stacking原创 2017-07-20 15:37:47 · 571 阅读 · 0 评论 -
codeforces831B
B. Keyboard Layoutstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are two popular keyboard layouts i原创 2017-07-14 14:08:02 · 456 阅读 · 0 评论 -
codeforces 814A
A. An abandoned sentiment from pasttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA few years ago, Hitagi原创 2017-06-10 11:47:54 · 271 阅读 · 0 评论 -
Codeforces 779B(暴力)
B. Weird Roundingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp is crazy about round numbers. He原创 2017-03-01 17:11:56 · 374 阅读 · 0 评论 -
codeforces 251A(普通队列or单调队列or二分)
Little Petya likes points a lot. Recently his mom has presented himnpoints lying on the lineOX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance betw...原创 2017-03-18 10:51:47 · 984 阅读 · 0 评论 -
codeforces721A
A. One-dimensional Japanese Crosswordtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently Adaltik disco原创 2017-03-11 20:28:59 · 338 阅读 · 0 评论 -
codeforces 789B(分类讨论)
B. Masha and geometric depressiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMasha really loves algebra原创 2017-04-07 16:12:57 · 460 阅读 · 0 评论 -
codeforces 789A(数学)
A. Anastasia and pebblestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnastasia loves going for a walk in原创 2017-04-07 16:25:22 · 508 阅读 · 0 评论 -
Codeforces 796A
A. Buying A Housetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputZane the wizard had never loved anyone be原创 2017-04-13 16:44:02 · 559 阅读 · 0 评论 -
codeforces 792A(水题)
A. New Bus Routetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n cities situated along the main原创 2017-04-06 13:14:21 · 607 阅读 · 0 评论 -
codeforces 792B
B. Counting-out Rhymetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputn children are standing in a circle an原创 2017-04-06 13:24:00 · 530 阅读 · 0 评论 -
Codeforces 779C(结构体妙用+标记数组)
C. Dishonest Sellerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIgor found out discounts in a shop and原创 2017-03-01 17:02:19 · 551 阅读 · 0 评论 -
Codeforces 805A(数学)
Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path.You are given l and r. For all integers from l to r, inclusive,原创 2017-05-06 11:09:07 · 905 阅读 · 0 评论 -
Codeforces 805 B
B. 3-palindrometime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the beginning of the new year Keivan deci原创 2017-05-06 11:13:31 · 391 阅读 · 0 评论 -
Codeforces 577B(dp)
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a sequence of numbers a1, a2, ..., an, and a num原创 2017-05-16 20:04:46 · 350 阅读 · 0 评论 -
codeforces 816A
time limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputKaren is getting ready for a new school day!It is currentl原创 2017-06-18 19:19:27 · 458 阅读 · 0 评论 -
Codeforces 804B
B. Minimum number of stepstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe have a string of letters 'a' a原创 2017-06-10 11:38:23 · 288 阅读 · 0 评论