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 ;
}

最新文章

  1. 4、解析配置文件 redis.conf、Redis持久化RDB、Redis的主从复制
  2. Excel中如何过滤复选框 How to filter checkbox column in Excel
  3. MarkDown初体验
  4. 002 C#学前入门
  5. 2016.02.17 JS DOM编程艺术 第四五六章
  6. 关于移动端的font和图片的问题
  7. 解决“Xlib.h not found when building graphviz on Mac OS X 10.8”错误
  8. API测试自动化——基于CDIF的SOA基本功能(实例篇)
  9. R语言命令行参数
  10. [C#] 获取计算机内部信息 - ComputerInfoHelper
  11. MongoDB远程维护客户端工具的使用!
  12. 如何写jquery插件
  13. Python两个栈实现一个队列
  14. 解决openoffice进程异常退出的办法
  15. mysql修改表结构语句
  16. iOS 扩展类方法之category!
  17. TypeError: &#39;newline&#39; is an invalid keyword argument for this function 错误解决
  18. 如何选择 .NET Framework目标版本
  19. 解析Java的JNI编程中的对象引用与内存泄漏问题
  20. 将Android studio的工程导入到eclipse中

热门文章

  1. Rx.js实现原理浅析
  2. 数电学习笔记之CMOS传输门工作原理
  3. idea括号选中时出现一条下滑线(突出显示)打开或关闭方法
  4. 使用DockerFile构建运行GoWeb
  5. 链表(python)
  6. C#LeetCode刷题之#532-数组中的K-diff数对(K-diff Pairs in an Array)
  7. 将阿里矢量图添加到element-ui
  8. volatile的特性代码验证
  9. day1 linux常用命令(一)
  10. 用WEB方式开发WPF桌面程序