ZOJ 2477 Magic Cube(魔方) Time Limit: 2 Seconds Memory Limit: 65536 KB This is a very popular game for children. In this game, there's a cube, which consists of 3 * 3 * 3 small cubes. We can unwrap the cube, it will become like this: 这是个有名的儿童游戏.游戏…
Description Harry Potter has some precious. For example, his invisible robe, his wand and his owl. When Hogwarts school is in holiday, Harry Potter has to go back to uncle Vernon's home. But he can't bring his precious with him. As you know, uncle Ve…
https://leetcode.com/problems/zigzag-conversion/ The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G Y…
#define ONLINE_JUDGE #include<cstdio> #include <cstring> #include <algorithm> using namespace std; int A,B,sx,sy; char maz[101][101]; int vis[101][101]; const int dx[4]={0,1,0,-1}; const int dy[4]={-1,0,1,0}; int dir(char ch){ if(ch=='N'…
http://poj.org/problem?id=2632 #include<cstdio> #include <cstring> #include <algorithm> using namespace std; int A,B,n,m; int robot[101][3]; char rbuff[10]; int dir[255]; const int dx[4]={0,1,0,-1}; const int dy[4]={1,0,-1,0}; int action…
http://poj.org/problem?id=1068 #include<cstdio> #include <cstring> using namespace std; int ind[45]; bool used[45]; int r[21]; int l[21]; int len,n,llen; int w[21]; int main(){ int t; scanf("%d",&t); while(t--){ memset(used,0,siz…
115. Calendar time limit per test: 0.25 sec. memory limit per test: 4096 KB First year of new millenium is gone away. In commemoration of it write a program that finds the name of the day of the week for any date in 2001. Input Input is a line with t…
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2806 Accepted: 1865 Description This problem is a reverse case of the problem 2996. You are given the output of the problem H and your task is to find the correspond…