Educational Codeforces Round 20 B】的更多相关文章

Educational Codeforces Round 20  A. Maximal Binary Matrix 直接从上到下从左到右填,注意只剩一个要填的位置的情况 view code //#pragma GCC optimize("O3") //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<bits/stdc++.h> using namespace std; fu…
The main city magazine offers its readers an opportunity to publish their ads. The format of the ad should be like this: There are space-separated non-empty words of lowercase and uppercase Latin letters. There are hyphen characters '-' in some words…
題目鏈接: http://codeforces.com/problemset/problem/803/C 題意: 給出兩個數n, k, 將n拆分成k個數的和,要求這k個數是嚴格遞增的,並且這k個數的gcd盡量大... 思路: 顯然題目的要求是求 n = a1*cnt + a2*cnt + a3*cnt..+ak*cnt 其中a1<a2<a3..<ak 並且要求cnt盡量大: 要使cnt盡量大,那麼顯然a1...ak要盡量小, 那麼可以令a1...ak=1, 2, 3, ..k, 令key…
C. Maximal GCD time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given positive integer number n. You should create such strictly increasing sequence of k positive numbers a1, a2, ...…
C. Maximal GCD time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given positive integer number n. You should create such strictly increasing sequence of k positive numbers a1, a2, ...…
C. Maximal GCD time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given positive integer number n. You should create such strictly increasing sequence of k positive numbers a1, a2, ...…
B. Distances to Zero time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given the array of integer numbers a0, a1, ..., an - 1. For each element find the distance to the nearest zero…
A. Maximal Binary Matrix time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given matrix with n rows and n columns filled with zeroes. You should put k ones in it in such a way that th…
传送门 题意 Roma在玩一个游戏,一共玩了n局,赢则bourle+1,输则bourle-1,Roma将会在以下情况中退出 1.他赢了k个bourle 2.他输了k个bourle 现在给出一个字符串 'L':lose 'W':win '?':任意 'D':平局 输出一个字符串满足条件(Roma n局后离开要满足上述两个其中之一) 分析 dp题 令dp[i][j]表示进行i-1局比赛后,是否获得j个bourle. 如果第i局为'W': dp[i+1][j+1]=j; 如果第i局为'L':dp[i+…
Description You are given the array of integer numbers a0, a1, ..., an - 1. For each element find the distance to the nearest zero (to the element which equals to zero). There is at least one zero element in the given array. Input The first line cont…