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. 41-native关键字的理解

    使用 native 关键字说明这个方法是原生函数,也就是这个方法是用 C/C++等非Java 语言实现的,并且被编译成了 DLL,由 java 去调用. (1)为什么要用 native 方法 java ...

  2. Xcode11更改启动页设置方法

    新开了个项目,发现之前的启动页怎么也调不好,后来发现配置里边少了一行,所以整理一下,我使用的xcode版本是11. 以前的时候是在这2个中间,还有一行,通过下边2项来配置,现在更改了,附上新的教程.如 ...

  3. 基于boost的bind与function的一个简单示例消息处理框架

    前两年开始接触boost,boost库真是博大精深:今天简单介绍一下boost中之前用到的的bind与function,感觉挺实用的,分享给大家,我对boost用的也不多,让大家见笑了. 上次文发了一 ...

  4. 【模式识别与机器学习】——SVM举例

  5. Mysql Column 'xxxxx' in field list is ambiguous"

    使用了关联查询,两张表有相同的字段,所以说取值含糊不清: 使用别名.列名解决: 如 a.description

  6. C#LeetCode刷题之#278-第一个错误的版本(First Bad Version)

    问题 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/3985 访问. 你是产品经理,目前正在带领一个团队开发新的产品.不 ...

  7. CSS3动画旋转——(图片360°旋转)

    今天在重构网页特效的时候,想着用到一个css3的旋转特效.简单来一个demo. html <div class="box"> <img src="./y ...

  8. 【算法•日更•第二期】查找算法:三分VS二分

    ▎前言:函数 如果你已经上过初二的数学课了,那么你十有八九会被函数折磨到吐血,这是一种中考压轴题类的题目,往往分类讨论到你恶心.不过没学过也不打紧,现场讲解一下: ☞『数学中的函数』 一般地,如果在一 ...

  9. 浏览器自动化的一些体会5 webBrowser控件之winform和webBrowser的交互

    从winform访问webBrowser,大致就是利用webBrowser提供的解析dom的方法以及用InvokeScript方法执行javascript.这个相对比较简单. 从webBrowser访 ...

  10. Solon详解(一)- 快速入门

    一.Solon 最近号称小而美的的Solon框架,终于得空,搞了一把,发觉Solon确实好用,那Solon到底是什么,又是怎么好用呢? 什么是Solon? Solon参考过Spring boot 和 ...