- 博客(16)
- 收藏
- 关注
原创 I - Fire Game FZU - 2150
Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and then they star...
2018-05-31 20:33:05 654
原创 H - Pots POJ - 3414
You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;DROP(i) ...
2018-05-30 20:31:24 167
原创 G - Shuffle'm Up POJ - 3087
A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containin...
2018-05-30 19:39:03 135
原创 F - Prime Path POJ - 3126
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter...
2018-05-29 19:48:50 134
原创 E - Find The Multiple POJ - 1426
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than ...
2018-05-27 19:45:31 242
原创 D - Fliptile
Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M × N grid (1 ≤ M ≤ 1...
2018-05-27 19:29:24 106
原创 C - Catch That Cow POJ - 3278
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (...
2018-05-26 15:53:06 177
原创 B - Dungeon Master POJ - 2251
You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit...
2018-05-26 15:31:17 121
原创 A - 棋盘问题 POJ - 1321
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格...
2018-05-26 14:38:23 117
原创 二分查找
int BinarySearch(int a[], int l, int r, int key) { if(l > r) { return -1; } int mid = (l + r) >> 1; if(key == a[mid]) { return mid; } else if(key < a[mi...
2018-05-21 19:08:33 83
原创 高精度运算
#include <bits/stdc++.h>using namespace std;typedef long long ll;string add(string s, string s2) { string maxstr, minstr; if(s.length() > s2.length()) { maxstr = s; ...
2018-05-19 20:48:32 115
原创 最短路-SPFA
#include <bits/stdc++.h>using namespace std;typedef long long ll;void SPFA(int s) { for(int i = 0; i <= n; i++) { dis[i] = (1 << 30); } dis[s] = 0; vis[x] =...
2018-05-19 19:10:40 104
原创 最小生成树-Prim
#include <bits/stdc++.h>#define INF (1 << 30)using namespace std;int t, n, m, x, y, sum, cnt, t1, t2, t3, flag;int mp[10005][10005], vis[10005], dis[10005];void Prim() { for(int ...
2018-05-19 15:15:26 87
原创 最小生成树-Kruskal
#include <bits/stdc++.h>using namespace std;const int maxn = 1e6 + 10;char s[maxn], s2[maxn];int t, n, m, x, cnt, sum;int f[555];typedef long long ll;typedef long double ld;typedef stru...
2018-05-17 19:59:39 109
原创 KMP
#include <bits/stdc++.h>using namespace std;const int maxn = 1e6 + 5;char s[maxn], s2[maxn];int book[maxn];void getnext(char s2[]) { int i = 0, j = -1; book[0] = -1; while(s2[i...
2018-05-16 20:08:41 80
原创 第九届山东省省赛总结
山东省赛总结选拔时,虽然没进入正式队伍。还是抱着学习的态度去参加。热身赛的时候,没有午睡 状态不太好,敲代码是出现了许多小错误,导致后面用了大量时间来找错误。在热身赛中,我们队只做出了一个题,还是个水题。全是自己的原因,对字符串操作有瑕疵,在处理字符串的时候没有加反斜杠0,在我手中耽误了半个小时。然后节奏乱了,我就把位置让给了钟鑫豪。改了一分钟就改好了,然后就交了。后面开了两个题,我感觉我开的那个...
2018-05-16 19:10:30 200
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人