A题

分析:注意两个点之间的倍数差,若为偶数则为YES,否则为NO

 #include "iostream"
#include "cstdio"
#include "cstring"
#include "string"
#include "cmath"
using namespace std;
int main()
{
int x1,y1,x2,y2;
cin>>x1>>y1>>x2>>y2;
int x,y;
cin>>x>>y;
int cnt1=x2-x1;
int cnt2=y2-y1;
int flag=;
if(cnt1%x){
flag=;
}
if(cnt2%y){
flag=;
}
if(abs(abs(cnt1/x)-abs(cnt2/y))%){
flag=;
}
if(!flag){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}

B题

分析:先看只用第一个数是否满足情况,如果不行在加入第二个数,不行在加入第三个数,如此分别统计三种情况即可

 #include "iostream"
#include "cstdio"
#include "cstring"
#include "string"
#include "algorithm"
#include "set"
#include "vector"
using namespace std;
const int maxn=+;
long long a[maxn];
int n;
long long solve3(long long sum){
return (sum*(sum-)*(sum-)/);
}
long long solve2(long long sum){
return (sum*(sum-)/);
}
int main()
{
cin>>n;
for(int i=;i<n;i++)
cin>>a[i];
sort(a,a+n);
set<long long>h;
for(int i=;i<n;i++){
h.insert(a[i]);
}
set<long long>::iterator it;
vector<long long>q;
for(it=h.begin();it!=h.end();it++){
q.push_back(*it);
}
long long cnt1=,cnt2=,cnt3=;
for(int i=;i<n;i++){
if(a[i]==q[]){
cnt1++;
}else if(a[i]==q[]){
cnt2++;
}else if(a[i]==q[]){
cnt3++;
}
}
if(cnt1>=){
cout<<solve3(cnt1)<<endl;
}else if(cnt1==){
cout<<cnt2<<endl;
}else{
if(cnt2>=){
cout<<solve2(cnt2)<<endl;
}else{
cout<<cnt3<<endl;
}
}
return ;
}

C题

分析:因为两个数的差值最大不会超过18*9=162,所以直接暴力即可

 #include "iostream"
#include "cstdio"
#include "cstring"
using namespace std;
long long a,b;
long long solve(long long num){
long long ans=;
while(num){
long long mod=num%;
ans+=mod;
num/=;
}
return ans;
}
int main()
{
cin>>b>>a;
long long sum=b-a;
if(sum<=){
cout<<""<<endl;
return ;
}
long long cnt=;
if(b-a<=){
for(long long i=a;i<=b;i++){
long long tt=i;
//cout<<b-solve(tt)<<endl;
if((i-solve(tt))>=a)
cnt++;
}
cout<<cnt<<endl;
}else{
for(long long i=a;i<=a+;i++){
long long yy=i;
if((i-solve(yy))<a)
cnt++;
}
cout<<sum-cnt+<<endl;
}
return ;
}

Educational Codeforces Round 23的更多相关文章

  1. Educational Codeforces Round 23 E. Choosing The Commander trie数

    E. Choosing The Commander time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  2. Educational Codeforces Round 23.C

    C. Really Big Numbers time limit per test 1 second memory limit per test 256 megabytes input standar ...

  3. Educational Codeforces Round 23 B. Makes And The Product

    B. Makes And The Product time limit per test 2 seconds memory limit per test 256 megabytes input sta ...

  4. Educational Codeforces Round 23 F. MEX Queries 离散化+线段树

    F. MEX Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard inpu ...

  5. Educational Codeforces Round 23 D. Imbalanced Array 单调栈

    D. Imbalanced Array time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  6. Educational Codeforces Round 23 C. Really Big Numbers 暴力

    C. Really Big Numbers time limit per test 1 second memory limit per test 256 megabytes input standar ...

  7. Educational Codeforces Round 23 补题小结

    昨晚听说有教做人场,去补了下玩. 大概我的水平能做个5/6的样子? (不会二进制Trie啊,我真菜) A. 傻逼题.大概可以看成向量加法,判断下就好了. #include<iostream> ...

  8. Educational Codeforces Round 23 A-F 补题

    A Treasure Hunt 注意负数和0的特殊处理.. 水题.. 然而又被Hack了 吗的智障 #include<bits/stdc++.h> using namespace std; ...

  9. Educational Codeforces Round 40千名记

    人生第二场codeforces.然而遇上了Education场这种东西 Educational Codeforces Round 40 下午先在家里睡了波觉,起来离开场还有10分钟. 但是突然想起来还 ...

随机推荐

  1. CSS 选择器语法参考手册

    转自:http://www.w3school.com.cn/cssref/css_selectors.asp CSS3 选择器 在 CSS 中,选择器是一种模式,用于选择需要添加样式的元素. &quo ...

  2. JFinal2.0极速开发视频教程发布【转】

    原文:http://blog.dreamlu.net/blog/79 目前JFinal越来越火爆,而且使用的公司越来越多.鉴于市面上JFinal的学习资源不多,我们开始基于JFinal2.0录制学习视 ...

  3. Delphi使用进行post数据时超时设置

    因项目需要进行http的post提交数据,开始时用indy的idHttp组件,但是测试时发现当网络中断(如拔掉网线),idHttp的超时设置无效果,要等20秒才提示超时(参考网上的做法,将indy9升 ...

  4. CentOS yum update 与 yum upgrade 区别

    yum -y update 升级所有包同时也升级软件和系统内核 yum -y upgrade 只升级所有包,不升级软件和系统内核 官方文档:https://access.redhat.com/docu ...

  5. centos 下完全卸载 mysql5.6

    查看已经安装的服务 rpm –qa|grep -i mysql -i 作用是不区分大小写 yum remove mysql mysql-server mysql-libs compat-mysql51 ...

  6. sql中Cast()函数的用法

    一.MYSQL 只需要一个Cast()函数就能搞定.其语法为:Cast(字段名 as 转换的类型 ),其中类型可以为: BINARY[(N)]CHAR[(N)] 字符型DATE  日期型DATETIM ...

  7. linux shell简单实现数据库自动备份

    以centos系统为例,实现数据库自动备份.1.写一个shell: 12 #! /bin/bashmysqldump -cp --user=root --password='123' dbName | ...

  8. 配置 yum 源相关

    1. 修改yum配置 http://www.cnblogs.com/shuaixf/archive/2011/11/30/2268496.html 2. centos安装 epel 源 https:/ ...

  9. UITabBarController ---- 标签视图控制器

    直接上代码: // // AppDelegate.m // // #import "AppDelegate.h" #import "RootViewController. ...

  10. 生活娱乐 VERYCD的T恤设计大赛

    http://www.verycd.com/event/tee2011/ 购买网站: http://dianlv.taobao.com/