Codeforces Round #426 (Div. 2)A B C题+赛后小结
最近比赛有点多,可是好像每场比赛都是被虐,单纯磨砺心态的作用。最近讲的内容也有点多,即便是点到为止很浅显的版块,刷了专题之后的状态还是~"咦,能做,可是并没有把握能A啊"。每场网络赛,我似乎都没用上新学的东西,能用上新学东西的题我A不了...5555555555555555
这场CF,讲真,打的心态爆炸,首先A题无限WA,赛后看下WA的那组数据是输入有一个999999999的样例,死骗子,说好的数据是1e9呢,哪能有数据是1e10-1,于是用long long,一下子Accept接收不了了吧,这.....B题,水题,不说...C题,我能做,于是噼里啪啦一顿乱敲,还先打了个表感觉美滋滋肯定能A,然后开开心心T了,没想到二分,我好菜啊,然后今天补题时候瞄到一些AC外国友人的round()和cbrt()这种骚操作,学到了,学到了...后面题没看,但讲真,这3题都是那种按理说能A的题,可是,就是因为菜..........55555555555
今晚还有场,接着打吧,唉~
题目链接:
http://codeforces.com/contest/834
A. The Useless Toy
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <string.h>
#include <iostream>
#include<algorithm>
#include <queue>
#include <vector>
#include <cmath>
#include<string>
#define inf 0x3f3f3f3f
using namespace std;
const int maxn=1e5+;
#define lrt (rt*2)
#define rrt (rt*2+1)
#define LL long long
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
#define exp 1e-8
#define For(i,n) for(int i=0;i<n;i++)
//************************************************
char a1[],a2[];
long long n;
int main()
{
scanf("%s%s",a1,a2);
char s1=a1[],s2=a2[];
scanf("%I64d",&n);
/*printf("%d %d %d\n",s1,s2,n);*/
/*if((s1==118&&s2==94)||(s1==94&&s2==118)||(s1==60&&s2==62)||(s1==62&&s2==60)|| (s1==s2)) puts("undefined");*/ if(s1==)
{
if(s2==)
{
if(n%==) puts("cw");
else if(n%==) puts("ccw");
else puts("undefined");
}
else if(s2==)
{
if(n%==) puts("ccw");
else if(n%==) puts("cw");
else puts("undefined");
}
else puts("undefined");
} else if(s1==)
{
if(s2==)
{
if(n%==) puts("cw");
else if(n%==) puts("ccw");
else puts("undefined");
}
else if(s2==)
{
if(n%==) puts("ccw");
else if(n%==) puts("cw");
else puts("undefined");
}
else puts("undefined");
} else if(s1==)
{
if(s2==)
{
if(n%==) puts("cw");
else if(n%==) puts("ccw");
else puts("undefined");
}
else if(s2==)
{
if(n%==) puts("ccw");
else if(n%==) puts("cw");
else puts("undefined");
}
else puts("undefined");
} else if(s1==)
{
if(s2==)
{
if(n%==) puts("cw");
else if(n%==) puts("ccw");
else puts("undefined");
}
else if(s2==)
{
if(n%==) puts("ccw");
else if(n%==) puts("cw");
else puts("undefined");
}
else puts("undefined");
}
return ;
}
B. The Festive Evening
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <string.h>
#include <iostream>
#include<algorithm>
#include <queue>
#include <vector>
#include <cmath>
#include<string>
#define inf 0x3f3f3f3f
using namespace std;
const int maxn=1e6+;
#define lrt (rt*2)
#define rrt (rt*2+1)
#define LL long long
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
#define exp 1e-8
#define For(i,n) for(int i=0;i<n;i++)
//************************************************
int main()
{
ios_base::sync_with_stdio(false); int n, k, len, num=, a[], b[];
char s[maxn];
cin >> n >> k>>s;
len=strlen(s);
for(int i = ; i < len; i++) a[s[i] - 'A']++;
for(int i = ; i < len; i++)
{
b[s[i] - 'A']++;
if(b[s[i] - 'A'] == ) num++;
if(num > k)
{
puts("YES");
return ;
} if(a[s[i] - 'A'] == b[s[i] - 'A']) num--;
}
puts("NO"); return ;
}
C. The Meaningless Game
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <string.h>
#include <iostream>
#include<algorithm>
#include <queue>
#include <vector>
#include <cmath>
#include<string>
#define inf 0x3f3f3f3f
using namespace std;
const long long maxn=1e6;
#define lrt (rt*2)
#define rrt (rt*2+1)
#define LL long long
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
#define exp 1e-8
#define For(i,n) for(int i=0;i<n;i++)
//************************************************
LL n,a,b;
int main()
{
ios_base::sync_with_stdio(false);
cin>>n;
for(int i=; i<=n; i++)
{
cin>>a>>b;
bool flag=false;
LL k=cbrt(a*b),x=a/k,y=b/k;
if(x*x*y==a&&y*y*x==b) flag=true;
if(flag) puts("YES");
else puts("NO");
}
return ;
}
Codeforces Round #426 (Div. 2)A B C题+赛后小结的更多相关文章
- CodeForces 834C - The Meaningless Game | Codeforces Round #426 (Div. 2)
/* CodeForces 834C - The Meaningless Game [ 分析,数学 ] | Codeforces Round #426 (Div. 2) 题意: 一对数字 a,b 能不 ...
- Codeforces Round #524 (Div. 2)(前三题题解)
这场比赛手速场+数学场,像我这样读题都读不大懂的蒟蒻表示呵呵呵. 第四题搞了半天,大概想出来了,但来不及(中途家里网炸了)查错,于是我交了两次丢了100分.幸亏这次没有掉rating. 比赛传送门:h ...
- Codeforces Round #426 (Div. 2) A,B,C
A. The Useless Toy 题目链接:http://codeforces.com/contest/834/problem/A 思路: 水题 实现代码: #include<bits/st ...
- Codeforces Round #426 (Div. 2)【A.枚举,B.思维,C,二分+数学】
A. The Useless Toy time limit per test:1 second memory limit per test:256 megabytes input:standard i ...
- Codeforces Round #426 (Div. 2)
http://codeforces.com/contest/834 A. The Useless Toy 题意: <,>,^,v这4个箭头符号,每一个都可以通过其他及其本身逆时针或者顺时针 ...
- Codeforces Round #426 (Div. 2) C. The Meaningless Game
C. The Meaningless Game 题意: 两个人刚刚开始游戏的时候的分数, 都是一分, 然后随机一个人的分数扩大k倍,另一个扩大k的平方倍, 问给你一组最后得分,问能不能通过游戏得到这样 ...
- Codeforces Round #426 (Div. 2)A题&&B题&&C题
A. The Useless Toy:http://codeforces.com/contest/834/problem/A 题目意思:给你两个字符,还有一个n,问你旋转n次以后从字符a变成b,是顺时 ...
- 【Codeforces Round #426 (Div. 2) A】The Useless Toy
[Link]:http://codeforces.com/contest/834/problem/A [Description] [Solution] 开个大小为4的常量字符数组; +n然后余4,-n ...
- 【Codeforces Round #426 (Div. 2) B】The Festive Evening
[Link]:http://codeforces.com/contest/834/problem/B [Description] [Solution] 模拟水题; 注意一个字母单个出现的时候,结束和开 ...
随机推荐
- [ Laravel 5.5 文档 ] 底层原理 —— 一次 Laravel 请求的生命周期
Posted on 2018年3月5日 by 学院君 简介 当我们使用现实世界中的任何工具时,如果理解了该工具的工作原理,那么用起来就会得心应手,应用开发也是如此.当你理解了开发工具如何工作,用起 ...
- 设计神器 - 摹客设计系统上线了 | 晒出你的设计规范,赢iPad Pro!
在国内,设计规范也许还是个不太常用的概念,但是如果你正好有参与互联网公司的产品设计,你应该早就已经体会到设计规范的重要性了.UI设计师总是要花费大量的时间和精力向开发描述一大堆设计细节,但是产品最后呈 ...
- ip白名单 通过* ? 检测IP匹配 轻量级
#include "stdafx.h" #include <windows.h> #include <string.h> #include <asse ...
- spring 注解 注入属性 和 注解完成bean定义
1. 使用 @Autowired 和 @Resource 注解来注入属性 2. 使用 @Component.@Repository.@Service.@Controller 注解,就将该类定义为一个B ...
- $.fn.extend 和$.extend函数
区别和详解:jQuery extend()和jQuery.fn.extend() 首先是简单的概述区别:$.extend()是类方法 $.fn.extend()是原型方法 对象方法和原 ...
- 2018.08.15 bzoj3747: [POI2015]Kinoman(线段树)
传送门 简单题. 先不管时间复杂度看看怎么做. 对于一段区间[l,r],如果从右端加入一个数a[r+1],对这个区间有什么影响?显然如果区间中已经有了a[r+1]这个数就会产生-a[i+1]的影响,否 ...
- 【转载】不得不知道的Python字符串编码相关的知识
原文地址:http://www.cnblogs.com/Xjng/p/5093905.html 开发经常会遇到各种字符串编码的问题,例如报错SyntaxError: Non-ASCII charact ...
- 20155212 2016-2017-2 《Java程序设计》第7周学习总结
20155212 2016-2017-2 <Java程序设计>第7周学习总结 教材学习内容总结 Chapter13 取得系统时间的方法之一是System.currentTimeMillis ...
- 【翻译】使用Vuex解决Vue中的身份验证
翻译原文链接:https://scotch.io/tutorials/handling-authentication-in-vue-using-vuex 我的翻译小站:https://www.zcfy ...
- Shell编程-06-Shell中的if语句
目录 基本语法 if示例 在任何一门语言中,判断语句总是少不了,今天来学习一下Shell中的if语句. 基本语法 单分支情况 第一种语法 if <条件表达式> then 语句 fi ...