比赛过程总结:过程中有事就玩手机了,后面打的状态不是很好,A题理解错题意,表明了内心不在状态,B题想法和思路都是完全正确的,但是并没有写出来,因为自己代码能力不强,思路不是特别清晰,把代码后面写乱了,而且出现了手误,这非常不应该。

反思:打下来应该想好,打代码的时候一气呵成,尽量避免调BUG,看错题这种低级错误,每天比赛时应该关闭手机。

本场目标:补题A-B-C-D-E

A-

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<map>
#include<vector>
#include<math.h>
using namespace std;
int a[];
int main(){
int n;
while(~scanf("%d",&n)){
int flag=;
int ans=;
for (int i=;i<=n;i++){
scanf("%d",&a[i]);
}
ans=;
int len=;
for (int i=;i<n;i++){
if (a[i]+==a[i+] && flag==){
len++;
if (a[i+]==){
len++;
}
}else if(a[i]+==a[i+] && flag==){
if (a[i]==){
len++;
}
if (a[i+]==){
len++;
}
flag=;
}else if(a[i]+!=a[i+] && flag==){
ans=max(ans,len);
len=;
flag=;
}
}
ans=max(ans,len);
printf("%d\n",ans);
}
return ;
}

B-

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
int e[];
int x[];
int kk;
int upbit(int x)
{
int s=;
while(s<x)
{
s*=;
kk++;
}
return s;
}
int main()
{
int n;
while(~scanf("%d",&n))
{
int cnt=;
kk=;
int maxx=;
int ans=;
int ans_k=;
memset(e,,sizeof(e));
memset(x,,sizeof(x));
for(int i=; i*i<=n; i++)
{
if(n%i==)
{
ans*=i;
e[++cnt]=i;
}
int k=;
while(n%i==)
{
n/=i;
k++;
x[cnt]=k;
maxx=max(k,maxx);
}
} if (n!=)
{
e[++cnt]=n;
x[cnt]=;
ans*=n;
}
if (maxx!=)
{
int s=upbit(maxx);
// cout<<maxx<<" "<<s<<endl;
for (int i=; i<=cnt; i++)
{
// cout<<x[i]<<endl;
if (x[i]<s)
{
kk++;
break;
}
}
printf("%d %d\n",ans,kk);
}
else printf("%d 0\n",ans);
}
return ;
}

CF每日一练 Codeforces Round #520 (Div. 2)的更多相关文章

  1. Codeforces Round #520 (Div. 2)

    Codeforces Round #520 (Div. 2) https://codeforces.com/contest/1062 A #include<bits/stdc++.h> u ...

  2. 【cf比赛记录】Codeforces Round #601 (Div. 2)

    Codeforces Round #601 (Div. 2) ---- 比赛传送门 周二晚因为身体不适鸽了,补题补题 A // http://codeforces.com/contest/1255/p ...

  3. 【cf比赛记录】Codeforces Round #600 (Div. 2)

    Codeforces Round #600 (Div. 2) ---- 比赛传送门 昨晚成绩还好,AC A,B题,还能上分(到底有多菜) 补了C.D题,因为昨晚对C.D题已经有想法了,所以补起题来也快 ...

  4. 【cf比赛记录】Codeforces Round #606 (Div. 2, based on Technocup 2020 Elimination Round 4)

    比赛传送门 只能说当晚状态不佳吧,有点头疼感冒的症状.也跟脑子没转过来有关系,A题最后一步爆搜没能立即想出来,B题搜索没有用好STL,C题也因为前面两题弄崩了心态,最后,果然掉分了. A:简单数学 B ...

  5. Codeforces Round #520 (Div. 2) E. Company(dfs序判断v是否在u的子树里+lca+线段树)

    https://codeforces.com/contest/1062/problem/E 题意 给一颗树n,然后q个询问,询问编号l~r的点,假设可以删除一个点,使得他们的最近公共祖先深度最大.每次 ...

  6. 【cf比赛记录】Codeforces Round #605 (Div. 3)

    比赛传送门 Div3真的是暴力杯,比div2还暴力吧(这不是明摆的嘛),所以对我这种一根筋的挺麻烦的,比如A题就自己没转过头来浪费了很久,后来才醒悟过来了.然后这次竟然还上分了...... A题:爆搜 ...

  7. Codeforces Round #520 (Div. 2) B. Math 唯一分解定理+贪心

    题意:给出一个x 可以做两种操作  ①sqrt(x)  注意必须是完全平方数  ② x*=k  (k为任意数)  问能达到的最小的x是多少 思路: 由题意以及 操作  应该联想到唯一分解定理   经过 ...

  8. Codeforces Round #520 (Div. 2) Solution

    A. A Prank Solved. 题意: 给出一串数字,每个数字的范围是$[1, 1000]$,并且这个序列是递增的,求最多擦除掉多少个数字,使得别人一看就知道缺的数字是什么. 思路: 显然,如果 ...

  9. Codeforces Round #520 (Div. 2) D. Fun with Integers

    D. Fun with Integers 题目链接:https://codeforc.es/contest/1062/problem/D 题意: 给定一个n,对于任意2<=|a|,|b|< ...

随机推荐

  1. [20181124]关于降序索引问题3.txt

    [20181124]关于降序索引问题3.txt --//链接:blog.itpub.net/267265/viewspace-2221425/,探讨降序索引中索引的键值.--//实际上使用函数sys_ ...

  2. django重定向

    return HttpResponseRedirect('/index/')# 重定向返回url格式:http://127.0.0.1:8000/index/会去掉前期的所有路由重新写入/index/ ...

  3. Mysql的NULL和Empty String

    本文基于Mysql5.7版本的参考资料: https://dev.mysql.com/doc/refman/5.7/en/working-with-null.html https://dev.mysq ...

  4. vmware中连接U盘

    1.首先安装VMware tools. 2.然后根据这篇经验操作  https://jingyan.baidu.com/article/7c6fb42828806480652c9062.html 3. ...

  5. [Hive_add_7] Hive 实现最高气温统计

    0. 说明 Hive 通过 substr() 函数实现最高气温统计 1. Hive 实现最高气温统计 1.1 思路 将一行文本加载为 String 通过 substr() 函数截取年份和温度 1.2 ...

  6. Windows重启显卡驱动热键说明

    Windows 有一个秘密的快捷键,可以重启显卡驱动程序.如果你的电脑经常“冻屏”,可以在重启电脑之前试试这个快捷键,它可以修复冻屏,否则就只能强制重启电脑了. 这个组合快捷键将重启 Win10 和 ...

  7. puppet 横向扩展(二)

    Table of Contents 1. 概述 2. 实验环境 3. 实验步骤 3.1. 机器B 的环境 3.1.1. 安装puppetmaster 以及 apache passenger 3.1.2 ...

  8. Three.js基础学习【修改版】

    一. Three.js官网及使用Three.js必备的三个条件 1.Three.js 官网 https://threejs.org/ 2.使用Three.js必备的三个条件(To actually b ...

  9. CSS 浮动(float)与定位(position)

    一.浮动 1.三个属性:left.right.none. 2.特点:容易造成父项塌陷,故在父项需要清除浮动 3.父项塌陷现象 4.父项塌陷解决方案(建议使用):清除浮动 .parent:after{ ...

  10. vue同一页面中拥有两个表单时,验证问题

    问题:如果vue的同一个页面拥有两个表单.验证第一个表单时没有通过就切换到第二个,那么第二个表单会出现验证错误的信息 我们可以通过为两个表单添加ref属性 之后在通过调用resetFields()方法 ...