这场比赛手速场+数学场,像我这样读题都读不大懂的蒟蒻表示呵呵呵. 第四题搞了半天,大概想出来了,但来不及(中途家里网炸了)查错,于是我交了两次丢了100分.幸亏这次没有掉rating. 比赛传送门:https://codeforces.com/contest/1080. A.Petya and Origami 题意:Petya要发出n张邀请函,每张请函需要2张红纸,5张绿纸,8张蓝纸.现在商店里有一些不同颜色的笔记本,每本中有k张颜色相同的纸,求最少要买几本笔记本. 这题就是一道模拟题,算出每种…
#include<bits/stdc++.h>using namespace std;long long dp[107];int main(){    int cnt=1;    dp[1]=1;    for(int i=2;i<=1e9;i*=2){        dp[++cnt]=dp[cnt-1]*4+1;//记录长度为2^cnt的正方形最多能被切割的次数    }    //for(int i=1;dp[i]!=0;i++)        //printf("%ll…
传送门 https://www.cnblogs.com/violet-acmer/p/10146350.html 题意: 有一块 n*m 的棋盘,初始,黑白块相间排列,且左下角为白块. 给出两个区间[ (x1,y1) , (x2,y2) ] 和 [ (x3,y3) , (x4,y4) ],第一个区间全部涂成白色,第二个区间全部涂成黑色,且颜色会覆盖. 求两块区间按照要求涂完后白块和黑快的个数? 题解: 我的想法如下: 先求出初始的黑块个数,然后,求出第一个区间减少的黑块个数,再求出第二个区间增加…
题目连链接:http://codeforces.com/contest/231 A. Team time limit per test:2 seconds memory limit per test:256 megabytes One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually…
C https://codeforces.com/contest/1130/problem/C 题意 给你一个\(n*m\)(n,m<=50)的矩阵,每个格子代表海或者陆地,给出在陆地上的起点终点,只允许挖一条穿越海的隧道,假设隧道连接的两个陆地分别为(x1,y1),(x2,y2),则挖隧道的花费为\((y1-x1)*(y1-x1)+(y2-x2)*(y2-x2)\) 题解 分别找出和起点,和终点连接的陆地(找联通块),枚举两个点维护最小值 代码 #include<bits/stdc++.h&…
C. Necklace 题目连接: http://www.codeforces.com/contest/613/problem/C Description Ivan wants to make a necklace as a present to his beloved girl. A necklace is a cyclic sequence of beads of different colors. Ivan says that necklace is beautiful relative…
https://codeforces.com/contest/1256 A:Payment Without Change[思维] 题意:给你a个价值n的物品和b个价值1的物品,问是否存在取物方案使得价值为s 题解:min(s/n,a)*n+b>=s?YES:NO #include<iostream> #include<cstdio> #include<cstdlib> #include<cmath> #include<algorithm>…
A. Array 题目连接: http://www.codeforces.com/contest/300/problem/A Description Vitaly has an array of n distinct integers. Vitaly wants to divide this array into three non-empty sets so as the following conditions hold: The product of all numbers in the…
A. Two Substrings 题意:给一个字符串,求是否含有不重叠的子串"AB"和"BA",长度1e5. 题解:看起来很简单,但是一直错,各种考虑不周全,最后只能很蠢的暴力,把所有的AB和BA的位置求出来,能有一对AB和BA不重叠即可. #include <bits/stdc++.h> using namespace std; ]; vector<int> ab; vector<int> ba; int main() { w…
A. Taymyr is calling you time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Comrade Dujikov is busy choosing artists for Timofey's birthday and is recieving calls from Taymyr from Ilia-alpinis…