DEC-UPDATE
12/19-12/26
# -*- coding: utf-8 -*- import sys
ans = [1,2,3,4,5,6] def operate(fun): a = ans[0]
b = ans[1]
c = ans[2]
d = ans[3]
e = ans[4]
f = ans[5] if fun == 'R':
ans[0] = d
ans[1] = c
ans[2] = a
ans[3] = b
elif fun == 'L':
ans[0] = c
ans[1] = d
ans[2] = b
ans[3] = a
elif fun == 'B': ##上
ans[2] = f
ans[3] = e
ans[4] = c
ans[5] = d
elif fun == 'C': ##下
ans[2] = e
ans[3] = f
ans[4] = d
ans[5] = c
elif fun == 'A': ##顺90
ans[0] = e
ans[1] = f
ans[4] = b
ans[5] = a
elif fun == 'F': ##逆90
ans[0] = f
ans[1] = e
ans[4] = a
ans[5] = b if __name__ == '__main__': while(True):
args = raw_input()
if args == 'q':
break
map(operate, args)
for e in ans:
sys.stdout.write(str(e))
ans = [1,2,3,4,5,6]
sys.stdout.write('\n')
Python CODE
#include <stdio.h>
#include <stdlib.h> #define INPUT 60 void L(int *ans);
void R(int *ans);
void F(int *ans);
void B(int *ans);
void A(int *ans);
void C(int *ans);
int getlen(char *test){
int c = ;
while(*test++ != '\0'){
c++;
} return c;
} int main()
{
int ans[] = {,,,,,};
char inputs[INPUT] = "";
int i = ; while(gets(inputs)){ for (i = ; i < getlen(inputs); i++){ if(inputs[i] == 'R'){
R(ans);
}else if(inputs[i] == 'L'){
L(ans);
}else if(inputs[i] == 'A'){
A(ans);
}else if(inputs[i] == 'B'){
B(ans);
}else if(inputs[i] == 'C'){
C(ans);
}else if(inputs[i] == 'F'){
F(ans);
}
}
for (i = ;i < ; i++){
printf("%d", ans[i]);
}
printf("\n");
for(i = ; i < ; i++){
ans[i] = i + ;
}
}
return ;
} void R(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = c;
t[] = d;
t[] = b;
t[] = a;
} void L(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = d;
t[] = c;
t[] = a;
t[] = b;
} void F(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = c;
t[] = d;
t[] = b;
t[] = a;
} void B(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = d;
t[] = c;
t[] = a;
t[] = b;
} void A(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = d;
t[] = c;
t[] = a;
t[] = b;
} void C(int *t){
int a = t[];
int b = t[];
int c = t[];
int d = t[]; t[] = c;
t[] = d;
t[] = b;
t[] = a;
}
C CODE
DEC-UPDATE的更多相关文章
- [洛谷 P3787] 冰精冻西瓜
题目描述 琪露诺是拥有操纵冷气程度的能力的妖精,一天她发现了一片西瓜地.这里有n个西瓜,由n-1条西瓜蔓连接,形成一个有根树,琪露诺想要把它们冷冻起来慢慢吃. 这些西瓜蔓具有神奇的性质,可以将经过它的 ...
- [ecmagnet][python基础]有关git那些事
#1 git教程 # 注册git服务器用户,权限-- 注意这个和客户端用户不是一样 # 客户端(linux)提交代码到本地仓库(简单版,了解原理) a.安装git sudo apt-get insta ...
- OCM 12c | OCM 12c Update | OCM 11g (Retiring Dec 31, 2019) | OCM 11g考试延期至2020.04.30
OCM 全球考试安排时间表 View A Worldwide OCM Schedule Oracle Database 12c Certified Master Exam (OCM) OCM 12c ...
- BZOJ 1691: [Usaco2007 Dec]挑剔的美食家 [treap 贪心]
1691: [Usaco2007 Dec]挑剔的美食家 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 786 Solved: 391[Submit][S ...
- 教新手一步步解决:Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to和更新gradle问题
android studio出现问题:Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_O ...
- BZOJ3389: [Usaco2004 Dec]Cleaning Shifts安排值班
3389: [Usaco2004 Dec]Cleaning Shifts安排值班 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 45 Solved: ...
- 通过 yum update 将系统从CentOS 6.2 升级到 CentOS 6.6 及升级过程中的简单排错
本文说明 本文写于2014年的WP中,后WP停止维护,今天翻到此记录整理下,记录于此,方便日后查看. 话说那时候写博客真是认真啊~哈哈~ 升级前的系统信息 [root@thatsit ~]# unam ...
- BZOJ1672: [Usaco2005 Dec]Cleaning Shifts 清理牛棚
1672: [Usaco2005 Dec]Cleaning Shifts 清理牛棚 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 414 Solved: ...
- Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to “*****”
Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment ...
- Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offli ...
随机推荐
- //C#中的访问数据符
[在命名空间里面直接定义类型只能用internal 或 public ] [要被同个解决方案内 其他项目访问 ,加引用 导命名空间]. [类的默认修饰符是internal] 1.Private ...
- win2008系统:iis配置备份和还原简单操作
(2013-09-26 16:33:22) 转载▼ 分类: 开发类 当我们电脑系统有大量的站点和虚拟目录的时候,电脑因为种种原因需要重做系统,那么重装系统后这些站点我们是否只能一个一个的添加,如果 ...
- Java严选
1,假如有两个线程,一个线程A,一个线程B都会访问一个加锁方法,可能存在并发情况,但是线程B访问频繁,线程A访问次数很少,问如何优化.(然后面试官说有了解过重度锁和轻度锁吗) a,竞争资源不激烈,选择 ...
- Serialize and Deserialize N-ary Tree
Serialization is the process of converting a data structure or object into a sequence of bits so tha ...
- 【转帖】windows命令行中java和javac、javap使用详解(java编译命令)
windows命令行中java和javac.javap使用详解(java编译命令) 更新时间:2014年03月23日 11:53:15 作者: 我要评论 http://www.jb51.ne ...
- PostgreSQL SQL优化之NOT IN问题
在我们平时写SQL时,如果遇到需要排除某些数据时,往往使用id <> xxx and id <> xxx,进而改进为id not in (xxx, xxx); 这样写没有问题, ...
- java_实现一个类只能声明一个对象
public class StaticDemo { public int a=10; private static StaticDemo s= new StaticDemo(); private St ...
- C++学习 之 类的继承中的虚函数(笔记)
1.多态行为 多态是面向对象语言的一种特征,让我们能够以类似的方式处理不同类型的对象.在C++中我们可以通过继承层次结构实现子类型多态. 我们可以通过下面的代码进一步了解多态: #include< ...
- 【2017.12.02】C组比赛总结
这次考得不怎么样,只有200分! T1:读书 这题水水水! 这题就是一道循环题嘛! 直接一边循环一边做就好了! T2:恐怖分子 这题我是直接暴力的. 这题就是求至少用多少条经过(x0,y0)的不同直线 ...
- 正则爬取某段子网站前20页段子(request库)
首先还是谷歌浏览器抓包对该网站数据进行分析,结果如下: 该网站地址:http://www.budejie.com/text 该网站数据都是通过html页面进行展示,网站url默认为第一页,http:/ ...