1018 Public Bike Management (30 分) There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to any other stations in the city. The Pub…
这个想法来自于数组链表,在数组链表中,数组的每一个元素对应一个指针,这个指针是下一个元素的index.用整数表示指针. 这是这个vector的源码: #include <iostream> using std::cout; template <typename T> class Vector { private: int m_block,m_size,m_asize; int *ip,*rip;//ip:actual->visual;rip:v->a T *tp; vo…
B. Preparing Olympiad You have n problems. You have estimated the difficulty of the i-th one as integer ci. Now you want to prepare a problemset for a contest, using some of the problems you've made. A problemset for the contest must consist of at le…
思路: 一道BFS题,和以前的BFS有点不同,这里的vis数组需要记录每次走时的状态,所以开了3维,只对该状态下的vis修改. 注意坑点:S的位置是可以走的 代码: #include<queue> #include<cstdio> #define ll long long using namespace std; const int N = 100+5; char mp[N][N]; bool vis[4][N][N]; int X1,Y1,X2,Y2,x,y,n,m,t,to[4…
Hie with the Pie Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 6436 Accepted: 3470 Description The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can affo…
Sudoku Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The other cells are empty. The goal is to fill the…