hdu 5292 Pocket Cube
来源:互联网 发布:脸太胖怎么办知乎 编辑:程序博客网 时间:2024/05/01 08:49
给一个二阶魔方的状态,可能安装错了,问是否可以还原。
作为一个Cuber,十分钟码出来怒拿此题FB。因为二阶魔方,可以做到交换任意两个块,所以块的位置是不用考虑的,只用考虑色向。因为黄白相对,考察黄白面的朝向,正确记为0,顺时针记为1,否则记为2,统统加起来能被3整除就是合法的。不要问我为什么,因为我是Cuber。
#include <iostream>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <string>#include <set>#include <algorithm>using namespace std;#define ll long longint main(){ int t; cin>>t; int cas=0; while(t--){ cas++; int ans=0; for(int i=1;i<=24;i++){ char color[2]; scanf("%s",color); if(color[0]=='w'||color[0]=='y'){ switch(i){ case 5: case 7: case 9: case 12: case 14: case 16: case 21: case 24: ans++; break; case 6: case 8: case 10: case 11: case 13: case 15: case 22: case 23: ans+=2; break; } } } printf("Case #%d: ",cas); if(ans%3==0){ printf("YES\n"); }else{ printf("NO\n"); } } return 0;}
0 0
- HDU 5292 Pocket Cube
- hdu 5292 Pocket Cube
- hdu 5292 Pocket Cube
- hdu 5292 Pocket Cube
- HDU 5292 Pocket Cube
- hdu 4801 Pocket Cube
- hdu 5983 Pocket Cube
- HDU 4801 Pocket Cube
- Pocket Cube HDU
- HDU 5983Pocket Cube
- HDU 4801 Pocket Cube BFS
- HDU 4801 Pocket Cube bfs
- [模拟]HDU 5983 Pocket Cube
- hdu 5983 Pocket Cube(模拟)
- 【HDU 5983 Pocket Cube】& 模拟
- HDU 5983 Pocket Cube 模拟
- HDU 5983 Pocket Cube (模拟)
- 2015 Multi-University Training Contest 1 Hdu 5292 Pocket Cube
- 日文游戏常见日语单词及读音
- ubuntu下X Windows下网络图标未出现以及后续的设备未托管问题解决方案。
- your project contains error(s),please fix them before running your application
- 统计字符
- SonarQube 安装及配置
- hdu 5292 Pocket Cube
- Swift2学习:Swift概览3-函数和闭包
- cuda sdk中各文件翻译及功能
- php中curl的使用
- java监听器用法(二):窗口监听器
- LeetCode || Search in Rotated Sorted Array
- OC_数组 NSSArry中一些重要的用法
- C语言不使用库函数对字符串操作
- android遮挡系统拨号界面 类似360来电显示的那个绿色 页面