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 ...
随机推荐
- java:activiti(工作流简介 )
1.工作流:(workflow) 整个工作的流程 eg:请假工作流 (我)员工-->组长-->经理-->主管-->人事-->总经理(董事会) eg:出差(报账)工作流 ( ...
- Unity中的动画系统和Timeline(3) 模型和动画导入
动画导入 美工做好的模型,直接将文件夹拖进来就导入好了.导入模型后,检查模型的材质贴图等是否丢失,若丢失,根据名字补上.如果美工取名规范,一一对应的话,就很简单.如果不是,那就呵呵哒. 有的美工做的比 ...
- flask 之(二) --- 视图|模版|模型
Flask框架 打开pycharm编译器,新建一个Flask项目,选择提前建好的虚拟环境 . 项目结构: static:静态资源文件,可以直接被浏览器访问 templates:模版文件,必须在项目的p ...
- Spring体系
1.Spring简介 Spring是一个轻量级Java开发框架,最早有Rod Johnson创建,目的是为了解决企业级应用开发的业务逻辑层和其他各层的耦合问题.它是一个分层的JavaSE/JavaEE ...
- rpm操作
--查找某个软件:abc rpm -qa |grep abc --删除某个软件:abc rpm -e --noscripts abc
- android webkit 初始化流程
以android 4.2为例 1, android 4.2中 WebViewClassic.java 为 WebView.java的代理类. 2,程序运行后,浏览器首先加载webkit so. Web ...
- Tensorflow实战第十课(RNN MNIST分类)
设置RNN的参数 我们本节采用RNN来进行分类的训练(classifiction).会继续使用手写数据集MNIST. 让RNN从每张图片的第一行像素读到最后一行,然后进行分类判断.接下来我们导入MNI ...
- ajax提交表单包含文件
需要用到 FormData. html: <form id="formPost"> name: <input name="name" /&g ...
- JavaSE编码试题强化练习1
1. 编写应用程序,创建类的对象,分别设置圆的半径.圆柱体的高,计算并分别显示圆半径.圆面积.圆周长,圆柱体的体积. /** * 定义父类--圆类 */ public class Circle { / ...
- Linux 磁盘卷扩容
首先识别磁盘,成功之后会显示在/dev下 [root@oracle01 ~]# fdisk /dev/sda ## /dev/sda为通过fdisk -l 查看到的物理磁盘(第一行) Welcome ...