思维题
文章平均质量分 64
Dband
我把委屈变成笑容 只想做个好梦
展开
-
C. Slava and tanks(思维)CodeForces 877C
B - B Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 877C use MathJax to parse formulasDescriptionSlava plays his favorite g...原创 2018-08-04 09:22:58 · 225 阅读 · 0 评论 -
【2019-浙江省赛】 Element Swapping(思维+数学) zoj4101
题目连接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=6003题目:题目大意:数组a通过交换一对数字,得到了b数组,给出如下的两个值问可能有多少种交换方式使得满足条件,x和y的值有可能是和数组不匹配的,这样的情况时输出0思路:求出交换后的数组的x1和y1,(y1-y)/(x1-x)即为交换的两个数的和如果, ...原创 2019-04-28 21:20:29 · 686 阅读 · 0 评论 -
CSL的字符串(牛客 上海高校程序设计竞赛)
链接:https://ac.nowcoder.com/acm/contest/551/D来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K题目描述 :CSL 以前不会字符串算法,经过一年的训练,他还是不会……于是他打算向你求助。给定一个字符串,只含有可打印字符,通过删除若干字符得到新字符串,新字符串必须满足两个条件: ...原创 2019-04-01 11:24:16 · 184 阅读 · 0 评论 -
H - Hotel Rewards(优先队列思维题)
7893 Hotel RewardsYou are planning to spend your holidays touring Europe, staying each night in a different city for Nconsecutive nights. You have already chosen the hotel you want to stay in for ea...原创 2018-10-29 20:13:45 · 216 阅读 · 0 评论 -
国庆10.3
A - A CodeForces - 1042AThere are n benches in the Berland Central park. It is known that ai people are currently sitting on the i-th bench. Another m people are coming to the park and each of them i...原创 2018-10-10 17:36:38 · 180 阅读 · 0 评论 -
国庆10.4
A - ACodeForces 1047A题目题目题意就是给一个数,把他分成三个数,这三个数求余3都不等于0如果是3的倍数,就分出来两个1如果不是就分出来一个1,一个2#include<iostream>#include <cstdio>#include <cstring>#include <cmath&gt原创 2018-10-16 20:34:51 · 110 阅读 · 0 评论 -
国庆10.6
A-CodeForces 714AToday an outstanding event is going to happen in the forest — hedgehog Filya will come to his old fried Sonya!Sonya is an owl and she sleeps during the day and stay awake from minut...原创 2018-10-09 15:39:55 · 308 阅读 · 0 评论 -
国庆10.7
A - Complete the Word(CodeForces 716B)DescriptionZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segment of letters) of it of length ...原创 2018-10-08 19:38:19 · 138 阅读 · 0 评论 -
国庆10.2
A-Equality CodeForces - 1038AYou are given a string s of length n, which consists only of the first k letters of the Latin alphabet. All letters in string s are uppercase.A subsequence of string s i...原创 2018-10-07 11:29:45 · 272 阅读 · 0 评论 -
国庆10.1
A - Turn the Rectangles CodeForces - 1008BThere are n rectangles in a row. You can either turn each rectangle by 90 degrees or leave it as it is. If you turn a rectangle, its width will be height, an...原创 2018-10-06 17:18:05 · 183 阅读 · 0 评论 -
Minimum Ternary String (CodeForces - 1009B)(思维题)
You are given a ternary string (it is a string which consists only of characters ‘0’, ‘1’ and ‘2’).You can swap any two adjacent (consecutive) characters ‘0’ and ‘1’ (i.e. replace “01” with “10” or v...原创 2018-10-06 11:05:08 · 184 阅读 · 0 评论 -
1.1.4 Broken Necklace
Description你有一条由N个红色的,白色的,或蓝色的珠子组成的项链(3<=N<=350),珠子是随意安排的。 这里是 n=29 的二个 例子: 1 2 1 2 r b b r b r r b r b ...原创 2018-09-25 20:20:58 · 489 阅读 · 0 评论 -
Prime Palindromes 回文质数
Description因为151即是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 号是回文质数。 写一个程序来找出范围[a,b](5 <= a < b <= 100,000,000)间的所有回文质数;Input第 1 行: 二个整数 a 和 bOutput输出一个回文质数的列表,一行一个。Sample Input5 500Sample Ou...原创 2018-09-25 19:15:23 · 368 阅读 · 0 评论 -
CodeForces 1016B Segment Occurrences(思维)
方法一:前缀和#include<cstdio>#include<cstring>#include<cstdlib>#include<cmath>#include<iostream>#include<algorithm>using namespace std;typedef long long ll;#def...原创 2018-08-10 10:40:39 · 260 阅读 · 0 评论 -
C-FLY(思维+数学)CodeForces 1011C
题目:http://codeforces.com/problemset/problem/1011/C题意:给你一个飞船,你从地球到火星再回来,已知飞船的重量和每个星球起飞和落下1吨燃料能支持多少重量的飞船起飞,求出最少需要的燃油的质量。思路:这个题要从后往前推,设 火箭加燃油的总质量为x,燃油的质量为y,那么, x+y/a[i]=y,得到y=x/(a[i]-1)#include &l...原创 2018-08-05 16:41:01 · 458 阅读 · 0 评论 -
【codeforces1081C】 Colorful Bricks(DP 排列组合)
DescriptionOn his free time, Chouti likes doing some housework. He has got one new task, paint some bricks in the yard.There are n bricks lined in a row on the ground. Chouti has got m paint buckets...原创 2019-05-22 15:44:18 · 377 阅读 · 0 评论