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 ...
随机推荐
- idea Ctrl+Alt+T 快捷键失效
idea快捷键 CTRL+ALT+T 把选中的代码放在 TRY{} IF{} ELSE{} 里 这个快捷键失效了,显然是热键冲突,查看了喜欢占热键的输入法.词典.微信.qq.都没找到占用,最后发现 ...
- react native 传值方式之 :子组件通过调用 其父组件传来的方法 传值回其父组件
- SQL常见面试题(学生表_课程表_总表)
问题描述: 为管理岗位业务培训信息,建立3个表: S (S#,SN,SD,SA) S#,SN,SD,SA 分别代表学号.学员姓名.所属单位.学员年龄 C (C#,CN ) C#,CN 分别代表课程编号 ...
- C#中StringBuilder类的使用总结
String 对象是不可改变的.每次使用 System.String 类中的方法之一时,都要在内存中创建一个新的字符串对象,这就需要为该新对象分配新的空间.在需要对字符串执行重复修改的情况下,与创建新 ...
- java中怎么调用python 脚本
调用方法: import java.io.BufferedReader; import java.io.InputStreamReader; public class PythonInvoke { p ...
- [转帖]微软 SQL Server 2008/R2 停止支持
微软 SQL Server 2008/R2 停止支持 微软停止支持 SQLSERVER 2008R2 https://t.cj.sina.com.cn/articles/view/3172142827 ...
- Shell初学(八)linux下的ACL
[1]ACL的作用 简单直接解释一下ACL的作用,即把权限的个别化额外添加. 可以解决如下问题~~比如: [1.1]基于用户: 我有10个用户a1-a10,我有一个文件夹/tmp/test,我想给a1 ...
- HYSBZ 1797 Mincut 最小割
Descrption A,B两个国家正在交战,其中A国的物资运输网中有N个中转站,M条单向道路.设其中第i (1≤i≤M)条道路连接了vi,ui两个中转站,那么中转站vi可以通过该道路到达ui中转站, ...
- Mysql workbench 字段类型(转载)
转载自:https://blog.csdn.net/j_h_xie/article/details/52924521 项目初始,在使用workbench建表时,字段中有PK,NN,UQ,BIN,UN, ...
- liunx忘记用户密码
1.vim /etc/my.cnf [mysqld] skip-grant-tables ##追加此行,跳过权限表, 2.重启mysql systemctl restart mysqld 3.mysq ...