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是否有意义?它最大的意义就是让我培养快速理解和应用一个个未知知识点的能力. ————————————————————————————————————— ...
随机推荐
- Centos 安装mysql8
Centos 安装mysql ,转载 https://www.cnblogs.com/funbin/p/11154784.html 1.下载mysql wget -i -c https://repo. ...
- as3鱼眼放大镜
package { //hi.baidu.com/inuko //bitmapdata fisheye magnifier //原创代码,如有雷同,纯属巧合 /* 本例是使用近似算法,只是最简单的鱼眼 ...
- Asp.net 代码设置兼容性视图
一.代码中设置兼容性 <summary> 兼容性视图 </summary> <param name="myPage"></param> ...
- Ado.Net查询语句使用临时表做条件
using System; using System.Data; using System.Data.SqlClient; using System.Text; namespace WindowsFo ...
- SpringBoot中resources配置文件application.properties
#项目名server.servlet.context-path=/springboot-day1#端口号server.port=8989 #datasource数据库连接信息#urlspring.da ...
- OO第四单元(UML)单元总结
OO第四单元(UML)单元总结 这是OO课程的第四个单元,也是最后一个单元.这个单元只有两次作业,相比前三个单元少一次作业.而且从内容上讲这个单元的作业目的以了解UML为主,所以相对前三个单元比较简单 ...
- 提高QPS
常用方案 1.异步化+MQ 即非阻塞,化繁为简,拿到你需要处理的资源后尽快回复.适用于事务处理场景,且无需对上游返回数据场景. 2.无锁设计 本质上是要降低锁冲突,基于数据版本的乐观锁 有效的减少了互 ...
- ASP.NET 一般处理程序 接收文件上传
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain&qu ...
- stage1----航空票务系统需求分析报告
航空票务管理系统需求分析报告 题 目 航空票务管理系统需求分析报告 学 院 信息科学与工程学院 专 业 计算机科学与技术 组 员 ...
- Java 之 Servlet中的生命周期
Servlet 生命周期 一.重写servlet方法 当创建一个类,继承 servlet 这个接口时,需要实现里面的抽象方法. import javax.servlet.*; import java. ...