
POJ
TheAlgorithmArt
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ_1112_Team Them Up!
#include #define inf 1000000using namespace std;const int MAXN = 101;int map[MAXN][MAXN];int id[2][MAXN];int color[MAXN];int dp[MAXN][MAXN];int tmp[MAXN][MAXN];struct { int c1, c2; int i, j;}pre[MAXN][MAXN];int N, t;bool DFS(原创 2010-08-04 21:41:00 · 2259 阅读 · 0 评论 -
POJ_1617_Crypto Columns
<br />#include <iostream>#include <string>#include <algorithm>using namespace std;char key[11];char word[11][11];char str[101];struct INDEX{ int index; bool operator<(const INDEX& o)const { return key[this->index]<key[o.index]; }原创 2010-08-29 16:59:00 · 695 阅读 · 0 评论 -
POJ_3051_Satellite Photographs
<br />#include <iostream>using namespace std;int w, h;int step[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};int visit[1001][81];char map[1001][81];int ans;bool Check(int x, int y){if (x >= h || x < 0 || y >= w || y < 0)return false;retu原创 2010-08-28 20:01:00 · 577 阅读 · 0 评论 -
POJ_3194_Equidivisions
<br />#include <iostream>using namespace std;int N, ans;int map[101][101];int visit[101][101];int step[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};int color[101];bool Check(int x, int y){ if (x >= N || x < 0 || y >= N || y < 0) return f原创 2010-08-28 18:26:00 · 711 阅读 · 0 评论 -
POJ_3125_Printer Queue
<br />#include<iostream>#include<queue>using namespace std;int main(){ int t, n, m, x; cin>>t; while(t--) { cin>>n>>m; queue<int>q; priority_queue<int>v; for(int i=0; i<n; i++) { cin>>x; q.push(x); v.push(x);原创 2010-08-28 16:54:00 · 577 阅读 · 0 评论 -
POJ_3510_A Tale from the Dark Side of the Moon
#include #include using namespace std;int main(){ freopen("test.txt", "r", stdin); while(true) { string s1; string s2 = ""; getline(cin, s1); int l = s1.length(); bool flag = true; for (int i = 0; i原创 2010-08-26 00:35:00 · 779 阅读 · 0 评论 -
POJ_1056_IMMEDIATE DECODABILITY
<br />#include <iostream>#include <vector>#include <string>#include <algorithm>using namespace std;int main(){ freopen("test.txt", "r", stdin); int n; vector<string> v; string s; int t = 1; while (cin>>s) { if (s[0] == '9')原创 2010-08-26 01:00:00 · 586 阅读 · 0 评论 -
POJ_3630_Phoe List
水题#include using namespace std;char phone[10001][11];int cmp(const void* a, const void* b){ return strcmp((char*)a, (char*)b);}int main(){ int t, n; freopen("test.txt", "r", stdin); scanf("%d", &t); while (t--) { scanf("%d"原创 2010-08-25 20:14:00 · 439 阅读 · 0 评论 -
POJ_3356_AGTC
<br />#include <iostream>#include <string>using namespace std;string s1, s2;int l1, l2;int LCS(int x, int y){ if (x >= l1 || y >= l2) return 0; if (s1[x] == s2[y]) return 1+LCS(x+1, y+1); return max(LCS(x, y+1), LCS(x+1, y));}原创 2010-08-26 00:29:00 · 412 阅读 · 0 评论 -
POJ_1606_Jugs
<br />#include <iostream>using namespace std;int A, B, C;struct { int i; int j; int method;}visit[1001][1001];struct{ int a; int b; int deep;}queue[100001];int result;int ra, rb;void Show(int a, int b){ int method =原创 2010-08-28 16:23:00 · 714 阅读 · 0 评论