B. Beautiful Paintings 题目连接: http://www.codeforces.com/contest/651/problem/B Description There are n pictures delivered for the new exhibition. The i-th painting has beauty ai. We know that a visitor becomes happy every time he passes from a painting…
B. Beautiful Paintings time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n pictures delivered for the new exhibition. The i-th painting has beauty ai. We know that a visitor becomes…
 cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....       其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
A. Joysticks time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Friends are going to play console. They have two joysticks and only one charger for them. Initially first joystick is charged at…
DFS A - Joysticks 嫌麻烦直接DFS暴搜吧,有坑点是当前电量<=1就不能再掉电,直接结束. #include <bits/stdc++.h> typedef long long ll; const int N = 1e5 + 5; int ans = 0; void DFS(int a, int b, int step) { if (a <= 0 || b <= 0) { ans = std::max (ans, step); return ; } if (a…
B. Beautiful Paintings time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n pictures delivered for the new exhibition. The i-th painting has beauty ai. We know that a visitor becomes…
题目链接:http://www.codeforces.com/problemset/problem/271/A题意:给你一个四位数,求比这个数大的最小的满足四个位的数字不同的四位数.C++代码: #include <iostream> #include <algorithm> using namespace std; bool chk(int x) { ]; ; i < ; i ++) { a[i] = x % ; x /= ; } sort(a, a + ); ; i &l…
C. Palindrome Transformation     Nam is playing with a string on his computer. The string consists of n lowercase English letters. It is meaningless, so Nam decided to make the string more beautiful, that is to make it be a palindrome by using 4 arro…
C. Beautiful Numbers 题目连接: http://www.codeforces.com/contest/300/problem/C Description Vitaly is a very weird man. He's got two favorite digits a and b. Vitaly calls a positive integer good, if the decimal representation of this integer only contains…
链接: https://codeforces.com/contest/1182/problem/C 题意: You are given n words, each of which consists of lowercase alphabet letters. Each word contains at least one vowel. You are going to choose some of the given words and make as many beautiful lyric…