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 ...
随机推荐
- 【转】Spark History Server 架构原理介绍
[From]https://blog.csdn.net/u013332124/article/details/88350345 Spark History Server 是spark内置的一个http ...
- axios在Vue中的简单应用(一)
1.安装axios: npm install --save axios vue-axios 2.安装qs: qs.stringify(data)可以解决data数据格式问题 npm install - ...
- PJzhang:今天才搞清身份证、银行卡……的编码规则
猫宁!!! 之前思考过常见证件的编码规则,抽空查了一下,发现挺有意思. 一般查询证件或者手机号归属地都是直接百度小工具,但是背后的查询机制如何,可能大多人不甚了解. 介绍几种生活中最 ...
- Linux文件权限码
权限 二进制值 八进制值 描述 --- 000 0 没有任何权限 --x 001 1 只有执行权限 -w- 010 2 只有写入权限 -wx 011 3 有写入和执行权限 r-- 100 4 只有读取 ...
- Pytorch1.0入门实战三:ResNet实现cifar-10分类,利用visdom可视化训练过程
人的理想志向往往和他的能力成正比. —— 约翰逊 最近一直在使用pytorch深度学习框架,很想用pytorch搞点事情出来,但是框架中一些基本的原理得懂!本次,利用pytorch实现ResNet神经 ...
- 让mysql的id字段变成表的主键
1.#已经加主键 desc szdj.sys_message_user;alter table sys_message_user add constraint pk_mess_user primary ...
- flutter环境配置(windows)
参考以下链接 下载安装步骤: https://www.cnblogs.com/yangyxd/p/8809512.html 安装Flutter环境遇到Android license status un ...
- JSON与对象,集合之间的转换
https://www.cnblogs.com/xiatc/p/8952739.html
- [转帖]流言终结者 —— “SQL Server 是Sybase的产品而不是微软的”
流言终结者 —— “SQL Server 是Sybase的产品而不是微软的” https://www.cnblogs.com/xxxtech/archive/2011/12/30/2307859.ht ...
- Python input/output boilerplate for competitive programming
The following code is my submission for Codeforces 1244C The Football Season. import io import sys i ...