B. HDD is Outdated Technology 题目连接: http://www.codeforces.com/contest/612/problem/B Description HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can…
题目链接:http://codeforces.com/problemset/problem/612/B 解题思路: 一开始看错了题意,他要求的是从1-n所耗费的时间,n表示的是数值而不是下标, 实现代码: #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <vector> #include <queue> #…
B. Queries on a String Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/598/problem/B Description You are given a string s and should process m queries. Each query is described by two 1-based indices li, ri and integer ki. I…
A. Diplomas and Certificates time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n students who have taken part in an olympiad. Now it's time to award the students. Some of them will…
题目链接:http://codeforces.com/contest/813/problem/B 题意:就是有一个数叫做不幸运数,满足题目的 n = x^a + y^b,现在给你一个区间[l,r],让你找一个在这个区间里面一个最长的区间使得这个区间里面的所有数都不是不幸运数,让你输出最长区间的区间长度 . 先用两个数组将x的n次方和y的n次方存起来,然后暴力枚举,用map将符合的条件的数存起来,不幸运数的区间就是两个幸运数的位置之差相减再减1.(注意map迭代器的用法) #include <bi…
A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given array consisting of n integers. Your task is to find the maximum length of an increasing subarray of the gi…
B. Grandfather Dovlet’s calculator   Once Max found an electronic calculator from his grandfather Dovlet's chest. He noticed that the numbers were written with seven-segment indicators (https://en.wikipedia.org/wiki/Seven-segment_display). Max starts…
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file for some programming competition problem. His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he will manually ge…
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic progressions: a1k + b1 and a2l + b2. Find the number of integers x such that L ≤ x ≤ R andx = a1k' + b1 = a2l' + b2, for some integers k', l' ≥ 0. 输入 Th…
[Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd. 输入 The only line contains odd integer n (1 ≤ n ≤ 49). 输出 Print n lines…