A

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<vector>
#include<cmath> const int maxn=1e5+;
typedef long long ll;
using namespace std; int main()
{
ll n;
scanf("%lld",&n);
ll ss=(+n)*n/;
ss+=(n)*(n-)/;
printf("%lld",ss);
return ;
}

B

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<vector>
#include<cmath> const int maxn=1e5+;
typedef long long ll;
using namespace std;
int a[];
int vis[];
int main()
{
int T;
cin>>T;
int n;
while(T--)
{
scanf("%d",&n);
for(int t=;t<n;t++)
{
scanf("%d",&a[t]);
}
int maxx=;
for(int t=;t<<<n;t++)
{
memset(vis,,sizeof(vis));
for(int j=;j<n;j++)
{
vis[n--j]=t>>j&;
}
int sum=;
for(int j=;j<n;j++)
{
if(vis[j]==)
{
sum++;
}
}
bool flag=false;
for(int j=;j<n;j++)
{
for(int k=j+;k<n;k++)
{
if(vis[j]==&&vis[k]==)
{
if(__gcd(a[j],a[k])!=)
{
flag=true;
}
}
}
}
if(flag==false)
{
maxx=max(maxx,sum);
} }
printf("%d\n",maxx);
} return ;
}

C

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<set>
#include<vector>
#include<map>
#include<cmath>
const int maxn=1e5+;
typedef long long ll;
using namespace std; char str1[*maxn],str2[*maxn]; int main()
{
int T;
cin>>T;
while(T--)
{
scanf("%s%s",str1,str2);
int len1=strlen(str1);
int len2=strlen(str2);
if(len1==len2+)
{
int cnt=;
for(int t=;t<len1;t++)
{
if(str2[cnt]==str1[t])
{
cnt++;
}
}
if(cnt==len2)
{
printf("1\n");
}
else
{
printf("0\n");
}
}
else
{
printf("0\n");
}
}
return ;
}

D:


#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<set>
#include<vector>
#include<map>
#include<cmath>
const int maxn=1e5+5;
typedef long long ll;
using namespace std;
int a[20]; int vis[25]; int main() { int x; for(int t=0;t<18;t++) { scanf("%d",&x); vis[x]++; } for(int t=1;t<14;t++) { if(vis[t]%2==0) { vis[t]=0; } else { vis[t]=1; } } int ans=0; for(int t=0;t<14;t++) { ans+=vis[t]; } cout<<ans<<endl; return 0; }

F:

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<set>
#include<vector>
#include<map>
#include<cmath>
const int maxn=1e5+;
typedef long long ll;
using namespace std;
int vis[][];
int dir[][]={{-,},{-,-},{,-},{,-},{,},{,},{,},{-,},{-,}};
int n,m;
bool check(int x,int y)
{
if(x>=&&x<=n&&y>=&&y<=m)
{
return true;
}
else
{
return false;
}
}
int main()
{
int q;
cin>>n>>m>>q;
int ans=(n-)*(m-);
int x,y;
while(q--)
{
scanf("%d%d",&x,&y);
vis[x][y]=;
int cnt=;
for(int t=;t<;t++)
{
int xx=x+dir[t][];
int yy=y+dir[t][];
if(check(xx,yy)&&vis[xx][yy]==)
{
cnt++;
} }
if(cnt==)
{ ans--;
}
cnt=;
for(int t=;t<;t++)
{
int xx=x+dir[t][];
int yy=y+dir[t][];
if(check(xx,yy)&&vis[xx][yy]==)
{
cnt++;
} }
if(cnt==)
{ ans--;
}
cnt=;
for(int t=;t<;t++)
{
int xx=x+dir[t][];
int yy=y+dir[t][];
if(check(xx,yy)&&vis[xx][yy]==)
{
cnt++;
} }
if(cnt==)
{ ans--;
}
cnt=;
for(int t=;t<;t++)
{
int xx=x+dir[t][];
int yy=y+dir[t][];
if(check(xx,yy)&&vis[xx][yy]==)
{
cnt++;
} }
if(cnt==)
{ ans--;
}
printf("%d\n",ans); }
return ;
}

H:

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
#include<set>
#include<vector>
#include<map>
#include<cmath> const int maxn=1e5+;
typedef long long ll;
using namespace std;
int a[*maxn];
int main()
{
int n;
cin>>n;
for(int t=;t<n;t++)
{
scanf("%d",&a[t]);
}
bool down=true;
int h=0x3f3f3f3f;
int ans=;
for(int t=;t<n;t++)
{
if(down)
{
if(a[t]>=h)
{
down=false;
ans++;
}
}
else
{
if(a[t]<=h)
{
down=true;
} }
h=a[t];
}
cout<<ans<<endl; return ;
}

cometoj(A-D+F+H)代码的更多相关文章

  1. 《linux 内核全然剖析》sched.c sched.h 代码分析笔记

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/u011368821/article/details/25129835 sched.c sched.h ...

  2. Good Bye 2018 (A~F, H)

    目录 Codeforces 1091 A.New Year and the Christmas Ornament B.New Year and the Treasure Geolocation C.N ...

  3. 2016CCPC长春 - B/D/F/H/I/J/K - (待补)

    目录: B - Fraction D - Triangle F - Harmonic Value Description H - Sequence I I - Sequence II B题:HDU 5 ...

  4. 2019牛客暑期多校训练营(第七场)E F H I

    E Find the median 题意:每次往序列中增加连续的[l,r]的数,每加入一次就询问当前序列的中位数. 解法:此题没有要求在线,那么直接离线+线段树+二分就可以了.求出每个端点之后排序得到 ...

  5. unix编程书中的 ourhdr.h代码

    真心不知到里面写的具体什么意思,先记下吧. /*Our own header, to be included after all standard system headers*/ #ifndef _ ...

  6. The 13th Chinese Northeast Collegiate Programming Contest(B C E F H J)

    B. Balanced Diet 思路:把每一块选C个产生的价值记录下来,然后从小到大枚举C. #include<bits/stdc++.h> using namespace std; ; ...

  7. eclipse使用ctrl+shift+F格式化代码失效

    通常情况出现这种问题是组合快捷键和别的软件快捷键冲突了, 最常见的是和搜狗输入法冲突, 在设置中找到搜狗输入法然后把冲突的快捷键取消掉就可以了.

  8. MyEclipse中Ctrl+Shift+F快捷键格式化代码时不换行

    摘自: http://iteye.blog.163.com/blog/static/18630809620121166622410/ MyEclipse中Ctrl+Shift+F快捷键格式化代码时不换 ...

  9. RapidJSON 代码剖析(四):优化 Grisu

    我曾经在知乎的一个答案里谈及到 V8 引擎里实现了 Grisu 算法,我先引用该文的内容简单介绍 Grisu.然后,再谈及 RapidJSON 对它做了的几个底层优化. (配图中的<Grisù& ...

随机推荐

  1. OpenCL Kernel设计优化

    使用Intel® FPGA SDK for OpenCL™ 离线编译器,不需要调整kernel代码便可以将其最佳的适应于固定的硬件设备,而是离线编译器会根据kernel的要求自适应调整硬件的结构. 通 ...

  2. 8月份Python招聘情况怎么样?Python爬取招聘数据,并进行分析

    前言 拉勾招聘是专业的互联网求职招聘平台.致力于提供真实可靠的互联网招聘求职找工作信息.今天我们一起使用 python 采集拉钩的 python 招聘信息,分析一下找到高薪工作需要掌握哪些技术 开发环 ...

  3. JAVA的基本程序设计结构(下)

    字符串 Java没有内置的字符串类型,而是在标准Java类库中提供了一个预定义类,叫做 String. String e=""; //an empty String String ...

  4. Springboot2.x整合logback slf4j

    Springboot项目的pom里引入的parent <parent> <groupId>org.springframework.boot</groupId> &l ...

  5. JQury的选择器

    jQuery 的选择器可谓之强大无比,这里简单地总结一下常用的元素查找方法 $("#myELement") 选择id值等于myElement的元素,id值不能重复在文档中只能有一个 ...

  6. JS 节点笔记

    h5新增自定义属性     为了保存并使用数据,有一些数据不必要保存到数据库中:     data开头作为自定义属性并赋值     兼容性获取element.getAttribute("da ...

  7. 怎么将PPT文件上传到微信公众号上?

    我们都知道创建一个微信公众号,在公众号中发布一些文章是非常简单的,但公众号添加附件下载的功能却被限制,如今可以使用小程序“微附件”进行在公众号中添加附件. 以下是公众号添加附件使用“微附件”小程序的教 ...

  8. Vue3 为何使用 Proxy 实现数据监听

    博客地址:https://ainyi.com/93 vue3 响应式数据放弃了 Object.defineProperty,而使用Proxy来代替它 我们知道,在 vue2 中,实现数据监听是使用Ob ...

  9. 从零搭建Spring Boot脚手架(3):集成mybatis

    1. 前言 今天继续搭建我们的kono Spring Boot脚手架,上一文集成了一些基础的功能,比如统一返回体.统一异常处理.快速类型转换.参数校验等常用必备功能,并编写了一些单元测试进行验证,今天 ...

  10. Linux文本处理详细教程

    1. 文本处理 本节将介绍Linux下使用Shell处理文本时最常用的工具: find.grep.xargs.sort.uniq.tr.cut.paste.wc.sed.awk: 提供的例子和参数都是 ...