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. BZOJ 1090 字符串折叠(Hash + DP)

    题目链接 字符串折叠 区间DP.$f[l][r]$为字符串在区间l到r的最小值 正常情况下 $f[l][r] = min(f[l][r], f[l][l+k-1]+f[l+k][r]);$ 当$l$到 ...

  2. python 获取时间 存入文件

    1读文件: file_path_name = '/home/robot/bzrobot_ws/src/bzrobot/bzrobot_comm/led_show_data/'+file_name+'. ...

  3. Crypto另外两段加密解密的代码

    第一段代码风格-平铺直叙: import sys from Crypto.Cipher import AES from binascii import b2a_hex, a2b_hex class p ...

  4. Windows使用Telnet连接Linux服务器初探(待实践)

    在Windows下可以适用Telnet连接Linux服务器,但是前提是在Linux下需要安装Tlenet-Server.还要开启防火的23端口.搞定之后就可以用telnet IP进行连接. 但是,我发 ...

  5. 391. Perfect Rectangle

    最后更新 一刷 16-Jan-2017 这个题我甚至不知道该怎么总结. 难就难在从这个题抽象出一种解法,看了别人的答案和思路= =然而没有归类总结到某种类型,这题相当于背了个题... 简单的说,除了最 ...

  6. weexpack build android 和 weexpack run android 报错 及 解决方案

    1. weexpack build android (1)Configuring > 0/3 projects > root project > Resolving dependen ...

  7. 【转载】C#扫盲之:==/Equals /ReferenceEquals 异同的总结,相等性你真的知道吗?

    1.前言 == Equals ReferenceEquals 三个相等性测试,是.NET提供给程序员使用的三个方法,他们之间有什么联系和区别,你真的仔细研究过?虽然之前也多多少少知道一点,但是有时候又 ...

  8. 【转载】C# 理解泛型

    术语表 generics:泛型type-safe:类型安全collection: 集合compiler:编译器run time:程序运行时object: 对象.NET library:.Net类库va ...

  9. v-model在其它元素以及类型上的用法

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. Canvas坐标轴中的Y轴距离是X轴的两倍

    如题,相信很多人在初次玩canvas的时候会出现这样的情况,跟着教程走的情况下,诶 怎么画出来的东西,不怎么对劲啊,,,ԾㅂԾ,,!!!!!先上代码 <!DOCTYPE html> < ...