A.Alyona and copybooks Problems: 给你一个数n和代价分别为a, b, c.数量不限的1, 2, 3,求将n凑成4的倍数的最小代价 Analysis: cj:取个模随便凑一凑就好 Tags: Implementation #define PRON "pa" #include <cstdio> #include <cstring> #include <iostream> #include <algorithm>…
A. Dasha and Stairs Problems: 一个按照1,2,3……编号的楼梯,给定踩过的编号为奇数奇数和偶数的楼梯数量a和b,问是否可以有区间[l, r]符合奇数编号有a个,偶数编号有b个. Analysis: cj: 纸张的我=.= 经过Return改正,才发现没有主义a = b = 0的情况. #define PRON "a" #include <cstdio> #include <cstring> #include <vector&g…
#include <iostream> #include <string> using namespace std; int main(){ int n; cin >> n; string str; cin >> str; , x = ; ; i < n ; ++ i){ if(str[i] == 'B') cnt+=(x << i); } cout<<cnt<<endl; }   Codeforces Round…
A.Anton and Danik Problems: 给你长度为N的,只含'A','D'的序列,统计并输出何者出现的较多,相同为"Friendship" Analysis: lucky_ji: 水题,模拟统计A和D的数目比较大小输出结果即可 Tags: Implementation B.Anton and Digits Problems: 给定k2个2,k3个3,k5个5及k6个6,可以组成若干个32或256,求所有方案中Sigma的最大值 Analysis: lucky_ji: 同…
题目跳转链接 A. Simply Strange Sort 题意 定义一个函数\(f_{i}\) : 如果\(a_i \ge a_{i+1}\) swap(\(a_i\) \(a_{i+1}\)) 定义一个操作: 第奇数次是 执行 \(f_1\) \(f_3\)... \(f_{n-2}\) 第偶数次是 执行 \(f_2\) \(f_4\)... \(f_{n-1}\) 求出进行多少次操作可以使原数组变得有序 思路 模拟上述操作即可 判断符合条件也可以用 is_sorted函数 AC_CODE…
Codeforces Round #486 (Div. 3) A. Diverse Team 题目连接: http://codeforces.com/contest/988/problem/A Description There are n students in a school class, the rating of the i-th student on Codehorses is ai. You have to form a team consisting of k students…
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/output 1 s, 256 MB  x2377 B Queue standard input/output 2 s, 256 MB  x1250 C Hacking Cypher standard input/output 1 s, 256 MB  x740 D Chocolate standard in…
CodeForces Round 199 Div2   完了,这次做扯了,做的时候有点发烧,居然只做出来一道题,差点被绿. My submissions     # When Who Problem Lang Verdict Time Memory 4434550 Sep 9, 2013 11:57:20 AM OIer E - Xenia and Tree GNU C++ Accepted 842 ms 4260 KB 4434547 Sep 9, 2013 11:56:11 AM OIer…
Codeforces Round #403 (Div. 2, based on Technocup 2017 Finals) 说一点东西: 昨天晚上$9:05$开始太不好了,我在学校学校$9:40$放学我呆到十点然后还要跑回家耽误时间....要不然$D$题就写完了 周末一些成绩好的同学单独在艺术楼上课然后晚上下第一节晚自习和他们在回廊里玩开灯之后再关上一片漆黑真好玩 A.Andryusha and Socks 日常煞笔提.....我竟然$WA$了一次忘了$n<<1$ #include <…
Codeforces Round #485 (Div. 2) https://codeforces.com/contest/987 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define IT set<ll>::iterator #define sqr(x) ((x)*(x)) #define pb…