题意:给一个字符串,对它重新排列使得它是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]的更多相关文章

  1. CodeForces Global Round 1

    CodeForces Global Round 1 CF新的比赛呢(虽然没啥区别)!这种报名的人多的比赛涨分是真的快.... 所以就写下题解吧. A. Parity 太简单了,随便模拟一下就完了. B ...

  2. Codeforces Global Round 1 - D. Jongmah(动态规划)

    Problem   Codeforces Global Round 1 - D. Jongmah Time Limit: 3000 mSec Problem Description Input Out ...

  3. Codeforces Global Round 2 题解

    Codeforces Global Round 2 题目链接:https://codeforces.com/contest/1119 A. Ilya and a Colorful Walk 题意: 给 ...

  4. Codeforces Global Round 1 (A-E题解)

    Codeforces Global Round 1 题目链接:https://codeforces.com/contest/1110 A. Parity 题意: 给出{ak},b,k,判断a1*b^( ...

  5. Codeforces Global Round 3

    Codeforces Global Round 3 A. Another One Bites The Dust 有若干个a,有若干个b,有若干个ab.你现在要把这些串拼成一个串,使得任意两个相邻的位置 ...

  6. Codeforces Global Round 1 (CF1110) (未完结,只有 A-F)

    Codeforces Global Round 1 (CF1110) 继续补题.因为看见同学打了这场,而且涨分还不错,所以觉得这套题目可能会比较有意思. 因为下午要开学了,所以恐怕暂时不能把这套题目补 ...

  7. 【手抖康复训练1 】Codeforces Global Round 6

    [手抖康复训练1 ]Codeforces Global Round 6 总结:不想复习随意打的一场,比赛开始就是熟悉的N分钟进不去时间,2333,太久没写题的后果就是:A 题手抖过不了样例 B题秒出思 ...

  8. Codeforces Global Round 11 个人题解(B题)

    Codeforces Global Round 11 1427A. Avoiding Zero 题目链接:click here 待补 1427B. Chess Cheater 题目链接:click h ...

  9. 【Codeforces Round 1110】Codeforces Global Round 1

    Codeforces Round 1110 这场比赛只做了\(A\).\(B\).\(C\),排名\(905\),不好. 主要的问题在\(D\)题上,有\(505\)人做出,但我没做出来. 考虑的时候 ...

  10. 树形DP ---- Codeforces Global Round 2 F. Niyaz and Small Degrees引发的一场血案

    Aspirations:没有结果,没有成绩,acm是否有意义?它最大的意义就是让我培养快速理解和应用一个个未知知识点的能力. ————————————————————————————————————— ...

随机推荐

  1. web页面元素定位

    所有web网页中有8种元素定位方式 靠单一的特征找元素:6种(id,class_name,tag_name,name,link_text(2))组合各种特征和关系来找元素:2种(xpath,css) ...

  2. Nvidia Jetson TX2开发板学习历程(1)- 详细开箱、上电过程

    考试周已经结束了,开发板也已经到了.希望借着这个假期能够好好的利用这块开发板学习Linux系统以及Tensorflow的相关知识. 我打算将学习历程通过博客的方式写出来,作为自己的笔记,也可以供以后拿 ...

  3. CMDB和自动化运维

    CMDB和自动化运维 IT运维的分类 IT运维,指的是对已经搭建好的网络,软件,硬件进行维护.运维领域也是细分的,有硬件运维和软件运维 硬件运维主要包括对基础设施的运维,比如机房的设备,主机的硬盘,内 ...

  4. SAS学习笔记60 统计SAS实例之T检验

    单样本 H0:服从正态分布 P=0.0988>0.05不拒绝H0,服从正态分布 H0:等于140t=-2.14,P=0.0397 P<0.05,拒绝H0,差异有统计学意义 均值x=130. ...

  5. pytorch learning rate decay

    关于learning rate decay的问题,pytorch 0.2以上的版本已经提供了torch.optim.lr_scheduler的一些函数来解决这个问题. 我在迭代的时候使用的是下面的方法 ...

  6. 转 C# 使用openssl

    //先用大整数来生成一个1024bit的密钥对 RSA rsa = new RSA(); BigNumber number = OpenSSL.Core.Random.Next(10, 10, 1); ...

  7. ubuntu ufw 配置

    ubuntu ufw 配置 Ubuntu 18.04 LTS 系统中已经默认附带了 UFW 工具,如果您的系统中没有安装,可以在「终端」中执行如下命令进行安装: 1 sudo apt install ...

  8. javascript, 元素 页面 简单碰撞

     <div>     </div>     <style>         div {             width: 100px;              ...

  9. JavaScript_day02

    10.随机数 随机数一般和数组组合使用. 生成随机数:使用Math.random()函数,生成的随机数0-1.一般乘以10^n扩大随机数范围. Math.round()函数和parseInt()函数. ...

  10. Fortify漏洞之Portability Flaw: Locale Dependent Comparison

    继续对Fortify的漏洞进行总结,本篇主要针对 Portability Flaw: Locale Dependent Comparison 漏洞进行总结,如下: 1.Portability Flaw ...