题目&题意: 倒着找处于最后位置的等差数列的开头的位置. 例: 1 5 3 4 5 6 3 4 5 6是等差数列,它的开头的位置是3 PS: 读题真的很重要!!!!多组输入,上来就读错了!! 代码: #include <bits/stdc++.h> #define inf 0x3f3f3f3f #define FRE() freopen("in.txt","r",stdin) using namespace std; typedef long l…
题目: Go Northwest! is a game usually played in the park main hall when occasional rainy weather discourages the visitors from enjoying outdoor attractions. The game is played by a pair of players and it is based entirely on luck, the players can hardl…
layout: post title: (寒假开黑gym)2018 ACM-ICPC, Syrian Collegiate Programming Contest(爽题) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces - DP - 状态压缩 - LCA 传送门 付队! C - Greetings! (状态压缩) 题意 给N种信件,你可以任意选择K种信封装信件,问你最少的浪费是多少 不能大的信件装…
题目&题意:(有点难读...) 给出一个数字序列,找出一个区间,当删除这个区间中的两个相同的数字后,只保留这两个数字之间的序列,然后继续删除相同的数字,问最多可以实行多少次删除操作. 例如: 所以执行两次删除操作. 思路: 区间dp,关键在于确定大的区间是由哪些小的区间转化来的. 当a[l] == a[r]的时候,dp[l][r] = dp[l+1][r-1]+1(因为要得到最多的删除次数,大的区间的次数在相等的情况下肯定是由内部小的区间加一得来的): 当a[l] != a[r]的时候,dp[l…
题目: To encourage visitors active movement among the attractions, a circular path with ice cream stands was built in the park some time ago. A discount system common for all stands was also introduced. When a customer buys ice cream at some stand, he…
题目: https://cn.vjudge.net/problem/1451310/origin 题意&思路: 纯粹模拟. 大体题意是这样的: 1.有人要在一个10-9<=x<=109,10-9<=y<=109,这么大的一张纸上去画图,而我们只需要打印输出最大为0<=x<=100,0<=y<=100范围内的图案就ok了. 2.如果s==0的话就在给出的坐标处画一个“_o_”( ASCII codes 95, 111, 95)的图案,表示a tree…
题目: A narrow gauge train drives the visitors through the sequence of chambers in the Dark Ride attraction. The chambers are occupied by IT monsters which are specially programmed to scare the visitors in various wicked ways. There is one monster in e…
题目:链接 思路: 多画出几个情况就可以找出规律来了 Knight (当大于2的时候只要两种颜色相间出现就可以了) King(当大于等于3的时候,总可以用四种形式来补色,具体如下)  Bishop(斜率为一的斜着的一行要不能相同,那只能是一列一个颜色了) Rook(要想水平竖直的颜色不一样,那只能是斜着的一行的颜色是一样的) 代码: #include <bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; typedef long…
题目: The cascade of water slides has been installed in the park recently and it has to be tested. The cascade consists of some number of reservoirs, or “ponds” for short, which are linked into a single sequence connected by water slides. Visitors are…
题目: The park management finally decided to install some popular boxing machines at various strategic places in the park. In fact, to compensate for the previous lack of machines, they decided to install as many machines as possible. Surprisingly enou…