题意:给一个字符串,对它重新排列使得它是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. Python基础 — eval 函数的作用

    eval函数就是实现list.dict.tuple与str之间的相互转化str函数把list,dict,tuple转为为字符串 # 字符串转换成列表a = "[[1,2], [3,4], [ ...

  2. REST-framework之频率组件

    REST-framework之频率控制 一 频率简介 为了控制用户对某个url请求的频率,比如,一分钟以内,只能访问三次 二 自定义频率类,自定义频率规则 自定义的逻辑 ""&qu ...

  3. 2. 执行Spark SQL查询

    2.1 命令行查询流程 打开Spark shell 例子:查询大于21岁的用户 创建如下JSON文件,注意JSON的格式: {"name":"Michael"} ...

  4. condition的使用

    condition 的作用:条件锁 需求: 按需执行三个线程. 用wait,notify的方式: /** * 有序线程 wait,notify版 */ public class OrderThread ...

  5. CF1097G Vladislav and a Great Legend 组合、树形背包

    传送门 看到\(k\)次幂求和先用斯特林数拆幂:\(x^k = \sum\limits_{i=1}^k \binom{x}{i}\left\{ \begin{array}{cccc} k \\ i \ ...

  6. 易百教程人工智能python修正-人工智能数据准备-预处理数据

    预处理数据 在我们的日常生活中,需要处理大量数据,但这些数据是原始数据. 为了提供数据作为机器学习算法的输入,需要将其转换为有意义的数据. 这就是数据预处理进入图像的地方. 换言之,可以说在将数据提供 ...

  7. Flutter 与 Android 的交互

    https://juejin.im/post/5cd91de4518825686b120921 https://juejin.im/entry/5b64292be51d451995676398

  8. 【转载】C#中List集合使用RemoveAt方法移除指定索引位置的元素

    在C#的List集合操作中,移除集合中的元素可以使用Remove方法,不过Remove方法的参数为具体的List集合中的元素,其实还可以使用List集合的RemoveAt方法来移除List集合中的元素 ...

  9. django路由系统及分发路由的本质

    路由系统 当我们启动一个django项目后,想要通过浏览器访问到django项目中的资源 就需要在django中的urls项目中进行路由配置 urlpatterns = [ url(r'^admin/ ...

  10. HTML学习摘要3

    DAY 3 浏览器会自动地在标题的前后添加空行 默认情况下,HTML 会自动地在块级元素前后添加一个额外的空行,比如段落.标题元素前后. <hr /> 标签在 HTML 页面中创建水平线. ...