URAL 2027 URCAPL, Episode 1 (模拟)】的更多相关文章

题意:给你一个HxW的矩阵,每个点是一个指令,根据指令进行一系列操作. 题解:模拟 #include<cstdio> #include<algorithm> using namespace std; ; char G[maxn][maxn]; ,,, }; ,,,-}; struct pointer { int r,c; int dir; void Move(){ r += dx[dir]; c += dy[dir]; } char read(){ return G[r][c];…
Prufer Code Time limit: 0.25 secondMemory limit: 8 MB A tree (i.e. a connected graph without cycles) with vertices is given (N ≥ 2). Vertices of the tree are numbered by the integers 1,-,N. A Prufer code for the tree is built as follows: a leaf (a ve…
Topological Sorting Time limit: 1.0 secondMemory limit: 64 MB Michael wants to win the world championship in programming and decided to study N subjects (for convenience we will number these subjects from 1 to N). Michael has worked out a study plan…
这两个题,讲的是有一种奇怪的语言,代码是一种二维的矩阵. 前一个题,是根据所给的要求,写一个简单的解释器. 后一个题,是用那种语言写一个简单的小程序. 挺有意思的,所以在这里纪念一下.顺便那个语言的原型是一种叫做Befunge的语言.真实存在的哟. 代码: 简单的解释器: #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath…
1218. Episode N-th: The Jedi Tournament Time limit: 1.0 secondMemory limit: 64 MB Decided several Jedi Knights to organize a tournament once. To know, accumulates who the largest amount of Force. Brought each Jedi his lightsaber with him to the tourn…
题目传送门 /* 模拟:找到规律分别输出就可以了,简单但是蛮有意思的 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <string> using namespace std; ; const int INF = 0x3f3f3f3f; void print_An(int n) { ; i<=n; ++i) { pr…
Episode N-th: The Jedi Tournament Time limit: 1.0 secondMemory limit: 64 MB Decided several Jedi Knights to organize a tournament once. To know, accumulates who the largest amount of Force. Brought each Jedi his lightsaber with him to the tournament.…
A - The First Day at SchoolTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87157#problem/A Description Vasya is a young and very promising android. Today is his first day at University. Vasya has ver…
space=1&num=1404">1404. Easy to Hack! Time limit: 1.0 second Memory limit: 64 MB When Vito Maretti writes an important letter he encrypts it. His method is not very reliable but it's enough to make any detective understand nothing in that lett…
This cheeseburger you don't need 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=1993 Description Master Yoda is the oldest member of the Jedi Council. He conducts preparatory classes of little Younglings up to the moment they get a mentor. All Yo…