HDU 5670 Machine
Machine
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 290 Accepted Submission(s):
179
changes.
For any changed bulb,
if it is red now it will be
green;
if it is green now it will be blue;
if it is blue now it
will be red and the bulb that on the left(if it exists) will change too.
Initally all the bulbs are red. What colour are the bulbs after the
button be
pushed n(1≤n<2^63) times?
contains an integer T(1≤T≤15) indicating the number of test cases. For each test case:
The only line
contains two integers m(2≤m≤30) and n(1≤n<263) .
left to right.
R indicates red. G indicates green. B indicates blue.
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int j=, i, T, m, a[];
__int64 n;
cin>>T;
while(T--)
{
j=;
scanf("%d%I64d", &m, &n);
while(n!=)
{
a[++j]=n%;
n=n/;
}
while(m>j)
{
cout<<"R";
m--;
}
for(i=m;i>=;i--)
if(a[i]==)
printf("R");
else if(a[i]==)
printf("G");
else
printf("B");
printf("\n");
}
return ;
}
HDU 5670 Machine的更多相关文章
- HDU 5670 Machine 水题
Machine 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5670 Description There is a machine with m(2 ...
- hdu 3842 Machine Works(cdq分治维护凸壳)
题目链接:hdu 3842 Machine Works 详细题解: HDU 3842 Machine Works cdq分治 斜率优化 细节比较多,好好体会一下. 在维护斜率的时候要考虑x1与x2是否 ...
- 匈牙利算法模板 hdu 1150 Machine Schedule(二分匹配)
二分图:https://blog.csdn.net/c20180630/article/details/70175814 https://blog.csdn.net/flynn_curry/artic ...
- hdu 1150 Machine Schedule 最少点覆盖转化为最大匹配
Machine Schedule Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...
- hdu 1150 Machine Schedule 最少点覆盖
Machine Schedule Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...
- hdu 1150 Machine Schedule(二分匹配,简单匈牙利算法)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1150 Machine Schedule Time Limit: 2000/1000 MS (Java/ ...
- HDU 4045 Machine scheduling (组合数学-斯特林数,组合数学-排列组合)
Machine scheduling Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...
- HDU 1150 Machine Schedule (二分图最小点覆盖)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1150 有两个机器a和b,分别有n个模式和m个模式.下面有k个任务,每个任务需要a的一个模式或者b的一个 ...
- POJ 1325、ZOJ 1364、HDU 1150 Machine Schedule - from lanshui_Yang
Problem Description As we all know, machine scheduling is a very classical problem in computer scien ...
随机推荐
- 使用 GitHub / GitLab 的 Webhooks 进行网站自动化部署
老早就想写这个话题了,今天正好有机会研究了一下 git 的自动化部署.最终做到的效果就是,每当有新的 commit push 到 master 分支的时候,就自动在测试/生产服务器上进行 git pu ...
- java中创建线程的几种方法及区别
1,实现Runnable接口创建线程 特点: A:将代码和数据分开,形成清晰的模型 B:线程体run()方法所在的类可以从其它类中继承一些有用的属性和方法 C:有利于保持程序风格的一致性 2,继承Th ...
- sql xml 入门
/*sql xml 入门: --by jinjazz --http://blog.csdn.net/jinjazz 1.xml: 能认识元素.属性和值 ...
- paper 51:图像复原
图像退化: 图像在形成.记录.处理和传输过程中,由于成像系统.记录设备.传输介质和处理方法的不完善,导致图像质量的下降,这种现象叫做图像退化. 图像复原: 就是对退化的图像进行处理,尽可能恢复出原始 ...
- 夺命雷公狗---Thinkphp----14之前台的首页完善
我们先来完成我们的首页部分,我们首页要先来完成到焊条部分和右侧的导航部分: 我们先来写控制器: 然后在右侧遍历头部遍历出我们所需要的数据: 因为我们的右侧是引入进来的,所以我们需要到右侧视图下进行遍历 ...
- ASP.NET 中通过Form身份验证 来模拟Windows 域服务身份验证的方法
This step-by-step article demonstrates how an ASP.NET application can use Forms authentication to ...
- Android中常用单位dp,px,sp之间的相互转换
MainActivity如下: package cc.testunitswitch; import android.os.Bundle; import android.util.DisplayMetr ...
- hadoop概述测试题和基础模版代码
hadoop概述测试题和基础模版代码 1.Hadoop的创始人是DougCutting?() A.正确 B.错误答对了!正确答案:A解析:参考课程里的文档,这个就不解释了2.下列有关Hadoop的说法 ...
- js获取IP地址方法总结_转
js代码获取IP地址的方法,如何在js中取得客户端的IP地址.原文地址:js获取IP地址的三种方法 http://www.jbxue.com/article/11338.html 1,js取得IP地址 ...
- PL/SQL显示行号和高亮当前行
PL/SQL Developer 如何显示行号: PL/SQL Developer 高亮当前行: OK!