题目链接:点击打开链接 题意: 给定n个箱子m个物品 以下n个数字表示箱子的容量 以下m个数字b1-bm 表示物品体积为2^bi大 问最多有多少个物品能够放入箱子. 思路: 贪心,先放小的,小的不能放再放大的 显然我们把n个箱子拆成二进制,然后模拟二进制减法运算. 剩下就是简单模拟 #include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> #include<m…
A. Extract Numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/problem/A Description You are given string s. Let's call word any largest sequence of consecutive symbols without symbols ',' (comma) and ';' (semicolon…
B. Complete the Word time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segmen…
地址:http://codeforces.com/contest/660/problem/B 题目: B. Seating On Bus time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Consider 2n rows of the seats in a bus. n rows of the seats on the left…
A. Fox and Box Accumulation time limit per test:1 second memory limit per test:256 megabytes Fox Ciel has n boxes in her room. They have the same size and weight, but they might have different strength. The i-th box can hold at most xi boxes on its t…
C. Shockers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Valentin participates in a show called "Shockers". The rules are quite easy: jury selects one letter which Valentin doesn't…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp loves ciphers. He has invented his own cipher called Right-Left. Right-Left cipher is used for strings. To encrypt the string s=s1s2…
C. Cardiogram time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output In this problem, your task is to use ASCII graphics to paint a cardiogram. A cardiogram is a polyline with the following corner…
C. Alyona and mex time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Alyona's mother wants to present an array of n non-negative integers to Alyona. The array should be special. Alyona is…
题目链接:http://codeforces.com/problemset/problem/723/B 题目大意: 输入n,给出n个字符的字符串,字符串由 英文字母(大小写都包括). 下划线'_' .括号'(' ')' 组成.[括号不会嵌套] 求括号外面的连续字符串最大的字符串长度和括号内的连续字符串的个数. 举例: input 37_Hello_Vasya(and_Petya)__bye_(and_OK) output 5 4 括号外面的连续的字符串最长的字符串长度为 5 括号内有 4 个连续…