Codeforces Round #267 (Div. 2) C. George and Job题目链接请点击~ The new ITone 6 has been released recently and George got really keen to buy it. Unfortunately, he didn't have enough money, so George was going to work as a programmer. Now he faced the follow…
A. Case of the Zeros and Ones Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/556/problem/A Description Andrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros an…
[感谢牛老板对D题的指点OTZ] codeforces 842 A. Kirill And The Game[暴力] 给定a的范围[l,r],b的范围[x,y],问是否存在a/b等于k.直接暴力判断即可. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace std; typede…
当时晚上打CF时候比较晚,加上是集训期间的室友都没有晚上刷题的习惯,感觉这场CF很不在状态.A题写复杂WA了一发后去厕所洗了个脸冷静了下,换个简单写法,可是用cin加了ios::sync_with_stdio(false)还是WA了,真无语.B题读半天题,读懂后轻松A了,看了下比赛时间就快结束了,把C题读了一遍后,感觉能做,最后还是选择了睡觉23333.................. A题大意:平平平 增平减 ,缺任一都可,判断是否为这样的数列 #include<stdio.h> #inc…
传送门 题意: 给出一个数x,有两个操作: ①:x ^= 2k-1; ②:x++; 每次操作都是从①开始,紧接着是② ①②操作循环进行,问经过多少步操作后,x可以变为2p-1的格式? 最多操作40次,输出操作数和所有操作中步骤①的操作数的k: 我的思路: 操作①每次都是异或 (k-1) 个1: 我们最终的结果是将 x 变为(p-1)个1: 那么,我们只要每次异或操作都将x中最高的0位变为1: 因为x最多只有20位,所以,完全可以在40个操作内将x变为(p-1)个1: 例如: 7654321(位置…
C. A and B and Team Training time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A and B are preparing themselves for programming contests. An important part of preparing for a competition is s…
B. A and B and Compilation Errors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A and B are preparing themselves for programming contests. B loves to debug his code. But before he runs t…
排序+暴力 #include<bits/stdc++.h> using namespace std; #define int long long #define N 1005000 int arr[N]; signed main(){ int _,n; cin>>_; while(_--){ cin>>n; ;i<=n;i++) cin>>arr[i]; sort(arr+,arr++n); ; ;i<=n;i++){ ; ; ;j--){ if…
A. Payment Without Change   #include<bits/stdc++.h> using namespace std; #define int long long #define N 100500 int arr[N]; signed main(){ int _; cin>>_; while(_--){ int a,b,n,s; cin>>a>>b>>n>>s; int y=s/n; int x=min(a,…
You are given two positive integers aa and bb . In one move, you can change aa in the following way: Choose any positive odd integer xx (x>0x>0 ) and replace aa with a+xa+x ; choose any positive even integer yy (y>0y>0 ) and replace aa with a−…