544B. Sea and Islands】的更多相关文章

题目链接 题意: n*n的里面全是S的方格中,填充L,若填充的L上下左右都没有相邻的L则是一个快,问题是能否形成k个块 n可以去奇数也可以去偶数 只要我们输出满足条件的一个结果就好了 对于从0 - n-1的矩阵下标,横纵坐标之和对于上面的两个图 画下划线的是符合条件的块,并且每个块只含有一个L 只需要对下边和是偶数的位置值为L,就可以了. n是奇数时候最多有 n*n/2+ 1 个块 n是偶数时候最多有 n*n 个块 Java程序: import java.util.Scanner; public…
题目传送门 /* 题意:在n^n的海洋里是否有k块陆地 构造算法:按奇偶性来判断,k小于等于所有点数的一半,交叉输出L/S 输出完k个L后,之后全部输出S:) 5 10 的例子可以是这样的: LSLSL SLSLS LSLSL SLSLS SSSSS */ #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <string> usi…
Sea and Islands time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea bu…
B. Sea and Islands Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/544/problem/B Description A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but yo…
Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Description A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of…
感觉今天早上虽然没有睡醒但是效率还是挺高的... Pas和C++换着写... 544A. Set of Strings   You are given a string q. A sequence of k strings s1, s2, ..., sk is called beautiful, if the concatenation of these strings is string q(formally, s1 + s2 + ... + sk = q) and the first cha…
Description The Shuseki Islands are an archipelago of 30001 small islands in the Yutampo Sea. The islands are evenly spaced along a line, numbered from 0 to 30000 from the west to the east. These islands are known to contain many treasures. There are…
题目: A. Mr. Kitayuta, the Treasure Hunter time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The Shuseki Islands are an archipelago of 30001 small islands in the Yutampo Sea. The islands are ev…
A. Set of Strings 题意:能否把一个字符串划分为n段,且每段第一个字母都不相同? 思路:判断字符串中出现的字符种数,然后划分即可. #include<iostream> #include<set> #include<cstdio> #include<cstring> using namespace std; ]; set<char>st; int main() { int n; scanf("%d%s", &a…
题目链接: C. Mr. Kitayuta, the Treasure Hunter time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The Shuseki Islands are an archipelago of 30001 small islands in the Yutampo Sea. The islands are…