Codeforces Global Round 6[A,B,C]
题意:给一个字符串,对它重新排列使得它是60的倍数。
模拟一下,需要能整除60 字符串中需要 能整除2 3 10,所以需要字符串各位数之和能整除3 并且有 一个偶数和一个0 或者两个0也行【没考虑到,WA到自闭QAQ】, 特殊情况 全为0 也行,
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int _;cin>>_;
while(_--){
string str;
cin>>str;
int flag=;int s=;
int flag1=;
for(int i=;i<str.size();i++){
if(str[i]==''){
flag++;
}
if((str[i]-'')%==&&(str[i]!='')){
flag1=;
}
s+=str[i]-'';
}
if((flag1&&s%==&&flag)||(s%==&&flag>=)){
cout<<"red"<<'\n';
}else{
cout<<"cyan"<<'\n';
}
}
return ;
} /* */
题意:给一个数,问他是不是可以由一个骰子塔的所有接触空气的面的数字构成。
思路:每一圈之和恒为14。则判断一下<14的就OK
#include<bits/stdc++.h>
using namespace std;
#define int long long signed main(){
int _;
cin>>_;
while(_--){ int n;
cin>>n;
if(n%<=&&n%>=&&n>=){
cout<<"YES";
}else{
cout<<"NO";
}
cout<<'\n';
}
return ;
}
题意:往一个矩阵里面填数,使得每行每列的gcd都两两各不相同。且最大的gcd最小。
思路:按照题意构造。
#include<bits/stdc++.h> using namespace std;
#define int long long
int arr[];
int mp[][];
signed main(){
int r,c;
cin>>r>>c;
if(r==&&c==){
cout<<"";
return ;
}
if(r==){
int num=;
for(int i=;i<=c;i++){
printf("%lld ",num);
num++;
}
}else if(c==){
int num=;
for(int i=;i<=r;i++){
printf("%lld\n",num);
num++;
}
}else{
int num=c+;
for(int i=;i<=r;i++){
arr[i]=num;
num++;
}
for(int i=;i<=c;i++){
for(int j=;j<=r;j++){
mp[j][i]=i*arr[j];
}
}
for(int i=;i<=r;i++){
for(int j=;j<=c;j++){
printf("%lld ",mp[i][j]);
}
printf("\n");
}
}
return ;
}
Codeforces Global Round 6[A,B,C]的更多相关文章
- CodeForces Global Round 1
CodeForces Global Round 1 CF新的比赛呢(虽然没啥区别)!这种报名的人多的比赛涨分是真的快.... 所以就写下题解吧. A. Parity 太简单了,随便模拟一下就完了. B ...
- Codeforces Global Round 1 - D. Jongmah(动态规划)
Problem Codeforces Global Round 1 - D. Jongmah Time Limit: 3000 mSec Problem Description Input Out ...
- Codeforces Global Round 2 题解
Codeforces Global Round 2 题目链接:https://codeforces.com/contest/1119 A. Ilya and a Colorful Walk 题意: 给 ...
- Codeforces Global Round 1 (A-E题解)
Codeforces Global Round 1 题目链接:https://codeforces.com/contest/1110 A. Parity 题意: 给出{ak},b,k,判断a1*b^( ...
- Codeforces Global Round 3
Codeforces Global Round 3 A. Another One Bites The Dust 有若干个a,有若干个b,有若干个ab.你现在要把这些串拼成一个串,使得任意两个相邻的位置 ...
- Codeforces Global Round 1 (CF1110) (未完结,只有 A-F)
Codeforces Global Round 1 (CF1110) 继续补题.因为看见同学打了这场,而且涨分还不错,所以觉得这套题目可能会比较有意思. 因为下午要开学了,所以恐怕暂时不能把这套题目补 ...
- 【手抖康复训练1 】Codeforces Global Round 6
[手抖康复训练1 ]Codeforces Global Round 6 总结:不想复习随意打的一场,比赛开始就是熟悉的N分钟进不去时间,2333,太久没写题的后果就是:A 题手抖过不了样例 B题秒出思 ...
- Codeforces Global Round 11 个人题解(B题)
Codeforces Global Round 11 1427A. Avoiding Zero 题目链接:click here 待补 1427B. Chess Cheater 题目链接:click h ...
- 【Codeforces Round 1110】Codeforces Global Round 1
Codeforces Round 1110 这场比赛只做了\(A\).\(B\).\(C\),排名\(905\),不好. 主要的问题在\(D\)题上,有\(505\)人做出,但我没做出来. 考虑的时候 ...
- 树形DP ---- Codeforces Global Round 2 F. Niyaz and Small Degrees引发的一场血案
Aspirations:没有结果,没有成绩,acm是否有意义?它最大的意义就是让我培养快速理解和应用一个个未知知识点的能力. ————————————————————————————————————— ...
随机推荐
- C++ 制作一个“测运”小游戏-rand()函数的应用
游戏说明: 游戏名:Lucky Guy 玩法说明:有2种模式可以选择,一种是一直选择数字,直到抽到炸弹为止.另一种是在0~9个数字中进行选择,有5个炸弹,最高分为5,抽到炸弹即游戏结束.游戏结束后,可 ...
- Linux 进程间通信(管道、共享内存、消息队列、信号量)
进程通信 : 不同进程之间传播或交换信息 为什么要进程通信呢? 协同运行,项目模块化 通信原理 : 给多个进程提供一个都能访问到的缓冲区. 根据使用场景,我们能划分为以下几种通信 ...
- Linux远程管理命令
关机\重启 shutdown 选项 时间 参数 -r 重启 例子: shutdown 1分钟后关机 shutdown now 立刻关机 shutdown –r now 立即重启 shutdown 20 ...
- Mybatis @One注解使用
@One注解:一对一关联查询
- springMvc之常用注解介绍
@requestbody和@requestparam的用法 获取请求参数的方法 get请求: 直接获取request 如: public String getHtml(HttpServletR ...
- .net core使用ocelot---第五篇 服务质量
简介 .net core使用ocelot---第一篇 简单使用 .net core使用ocelot---第二篇 身份验证使用 .net core使用ocelot---第三篇 日志记录 .net c ...
- Bootstraps 4 引入报错 Error: Bootstrap tooltips require Tether
问题: 解决办法 (http://github.hubspot.com/tether/) Bootstrap 4 needs Tether, so you need to include tether ...
- selenium用法详解以chrome为例
selenium 是一套完整的web应用程序测试系统,包含了测试的录制(selenium IDE),编写及运行(Selenium Remote Control)和测试的并行处理(Selenium Gr ...
- BUAA OO 2019 第四单元作业总结
目录 第四单元总结 总 UML UML 类图 UML 时序图 UML 状态图 架构设计 第十三次作业 第十四次作业 课程总结 历次作业总结 架构设计 面向对象方法理解 测试方法理解与实践 改进建议 尽 ...
- vue 全局挂载组件
<!-- plugin.js --> import someComponent from './components/someComponent' export default { ins ...