Codeforces Round #426 (Div. 2)
来源:互联网 发布:黑客网站源码 编辑:程序博客网 时间:2024/06/05 15:01
A. The Useless Toy
#include<bits/stdc++.h>#define ll long long using namespace std;int main(){ios::sync_with_stdio(0);cin.tie(0);char c1,c2;int n;cin>>c1>>c2;cin>>n;if(n%4==0){cout<<"undefined"<<'\n';} else if(n%4==1){if((c1=='^'&&c2=='>')||(c1=='>'&&c2=='v')||(c1=='v'&&c2=='<')||(c1=='<'&&c2=='^'))cout<<"cw"<<'\n';else if((c2=='^'&&c1=='>')||(c2=='>'&&c1=='v')||(c2=='v'&&c1=='<')||(c2=='<'&&c1=='^'))cout<<"ccw"<<'\n';else cout<<"undefined"<<'\n';}else if(n%4==2){cout<<"undefined"<<'\n';}else if(n%4==3){if((c1=='^'&&c2=='<')||(c1=='>'&&c2=='^')||(c1=='v'&&c2=='>')||(c1=='<'&&c2=='v'))cout<<"cw"<<'\n';else if((c2=='^'&&c1=='<')||(c2=='>'&&c1=='^')||(c2=='v'&&c1=='>')||(c2=='<'&&c1=='v'))cout<<"ccw"<<'\n';else cout<<"undefined"<<'\n';}return 0;}
B. The Festive Evening
#include<bits/stdc++.h>#define ll long long using namespace std;char s[1000010];map<char,int> mp,mmp;int main(){ios::sync_with_stdio(0);cin.tie(0);int n,k;cin>>n>>k;for(int i=0;i<n;i++){cin>>s[i];mp[s[i]]++;} int sum=0,ans=0;for(int i=0;i<n;i++){if(mp[s[i]]>0){if(mmp[s[i]]==0){mmp[s[i]]=1;sum++;ans=max(ans,sum); }mp[s[i]]--;}if(mp[s[i]]==0) sum--;}if(ans<=k) cout<<"NO"<<'\n';else cout<<"YES"<<'\n';return 0;}C - The Meaningless Game
#include<bits/stdc++.h>#define ll long long using namespace std;int main(){ll n, x, y, c, q;scanf("%lld",&n);while(n--){scanf("%lld%lld",&x,&y);c = x * y;q = floor(pow(c,1/3.0)+0.5);if((q*q*q==x*y)&&(x%q==0)&&(y%q==0)){printf("Yes\n");}else printf("No\n"); } return 0;}
阅读全文
0 0
- Codeforces Round #426 (Div. 2)
- Codeforces Round #426 (Div. 2)
- Codeforces Round #426 (Div. 2)
- Codeforces Round #426 (Div. 2)
- Codeforces Round #426 (Div. 2)
- Codeforces Round #426 (Div. 2) B
- Codeforces Round #426 (Div. 2) C
- Codeforces Round #426 (Div. 2) C
- Codeforces Round #426 (Div. 2)(A+B)
- Codeforces Round #426 (Div. 2)比赛总结
- Codeforces Round #426 (Div. 2) C
- Codeforces Round #102 (Div. 2)
- Codeforces Round #103 (Div. 2)
- Codeforces Round #103 (Div. 2)
- Codeforces Round #104 (Div. 2)
- Codeforces Round #105 (Div. 2)
- Codeforces Round #105 (Div. 2)
- Codeforces Round #107 (Div. 2)
- MySQL主从复制的实现过程
- LEMP setup
- [绍棠_Swift] Swift中的回调传值
- ssh 免密登录配置后还是无效
- HDU4109 Instrction Arrangement【差分约束】【拓扑排序】
- Codeforces Round #426 (Div. 2)
- 一分钟了解"特征值分解和奇异值分解SVD的区别"
- C#在执行此操作前必需先调用Bind方法的解决
- nyoj——58 最小步数(DFS,BFS 迷宫问题)
- 检查ESXi主机是否使能VT-x/AMD-V
- MySQL的事务隔离级别
- 常用sql语句
- 按照时间间隔查询数据库
- Tensorflow中队列的使用