![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
acm
Folieshell
这个作者很懒,什么都没留下…
展开
-
(Vanya and Lanterns)Codeforces Round #280 (Div. 2)B
此题链接单击这里================= 有问题联系企鹅791267032 邮箱地址….wutanrong@Hotmail.com原创 2015-08-08 15:49:37 · 438 阅读 · 0 评论 -
巡逻机器人(Patrol Roboot,UVa1600)
此题链接单击这里=================#include <iostream>#include <cstring>#include <cmath>using namespace std;int a[30][30];int c[21][21][21];int d[4][2]={-1,0,1,0,0,1,0,-1};int m,n;int zz;int loge;bool原创 2015-07-23 16:03:07 · 1521 阅读 · 0 评论 -
N皇后问题(HDU 2553)
此题链接单击这里=================#include <iostream>#include <cstring>#include <cmath>using namespace std;int N,k;int a[12];bool is(int ai,int aj){ int i=1; while(i<ai) { if(a[i]==aj原创 2015-07-23 16:27:11 · 421 阅读 · 0 评论 -
Red and Black(HDU 1312)
此题链接单击这里=================#include <iostream>#include <cstring>using namespace std;char a[25][25];int b[25][25];int c[4][2]={{-1,0},{0,-1},{1,0},{0,1}};int W, H,k;bool is(int ai,int aj){ if(原创 2015-07-23 16:29:40 · 311 阅读 · 0 评论 -
平衡的括号(Parentheses Balance,UVa 673)
此题链接单击这里=================栈的基本应用,只能‘(’与‘[’入栈,每输入一个‘)’与‘]’就与栈顶对比,能形成‘()’与‘[]’就出栈,形成’(]’与‘[)’就输出No,当栈为空时就输出Yes。 还有单独出现‘(’‘[’‘)’‘]’都要输出No。。。。。。 附代码#include <iostream>#include <stack>using namespace s原创 2015-07-23 15:15:32 · 643 阅读 · 0 评论 -
士兵队列训练问题(HDU 1276)
此题链接单击这里=================只是模拟过程 附代码#include <iostream>#include <cstring>#include <list>using namespace std;int main(){ int N; cin >> N; while (N--) { int m, a[5002];原创 2015-07-23 15:39:37 · 525 阅读 · 0 评论 -
二叉树重建(Tree Recovery ,UVa536)
此题链接单击这里=================这道题只知道前序、中序、后序遍历是无法做的,必须要知道前序、中序、后序之间的关系,这是做题的关键。#include <iostream>using namespace std;string str1,str2,str3;int p,k;void funt(int x,int d){ if(x==d) return ;原创 2015-07-23 15:52:10 · 558 阅读 · 1 评论 -
骑士的移动(Knight Moves,UVa 439)
此题链接单击这里=================这题刚做的时候并不知道马是怎么走的。。。。。。表示象棋玩的少。。。。。。#include <iostream>#include <cstdio>#include <cstring>#include <cstdlib>using namespace std;char c3, c4;int k;int c[127][127];int b1原创 2015-07-23 15:59:58 · 655 阅读 · 0 评论 -
Lake Counting(POJ 2386)
POJ打不开就不上链接了。。。。。 附代码#include <iostream>#include <cstring>using namespace std;char a[102][102];int b[102][102];int N,M,t;void funt(int ai,int aj,int t){ if(ai<1||ai>N||aj<1||aj>M)原创 2015-07-23 16:20:04 · 364 阅读 · 0 评论 -
Codeforces Round #326 (Div. 2) A. Duff and Meat
A. Duff and Meattime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuff is addicted to meat! Malek wants to ke原创 2016-05-29 11:01:23 · 364 阅读 · 0 评论 -
Codeforces Round #326 (Div. 2)B. Duff in Love
B. Duff in Lovetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuff is in love with lovely numbers! A posi原创 2016-05-29 11:24:56 · 381 阅读 · 0 评论 -
Codeforces Round #326 (Div. 1)A. Duff and Weight Lifting
A. Duff and Weight Liftingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, Duff has been practicin原创 2016-05-29 11:58:43 · 460 阅读 · 0 评论 -
Codeforces Round #327 (Div. 2)A. Wizards' Duel
A. Wizards' Dueltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHarry Potter and He-Who-Must-Not-Be-Named原创 2016-05-29 12:13:59 · 658 阅读 · 0 评论 -
循环多少次(HDU 1799)
此题链接单击这里=================用扬辉三角#include <iostream>using namespace std;long a[2010][2010];void funt(){ for(int i=1;i<=2001;i++) { a[i][1]=i%1007; a[i][i]=1; } for(int原创 2015-08-02 19:09:12 · 435 阅读 · 0 评论 -
矩形A + B(HDU 2524)
此题链接单击这里=================水题#include <iostream>using namespace std;int main(){ int t; cin>>t; while(t--) { int n,m; long num=0; cin>>n>>m; for(int i=1;原创 2015-08-02 19:15:39 · 440 阅读 · 0 评论 -
Soldier and Cards(Problem - 546C - Codeforces)
此题链接单击这里================= First sample: Second sample: 附代码#include <iostream>#include <queue>using namespace std;int main(){ int n; cin>>n; int a,b; queue<int>qu原创 2015-07-23 15:33:11 · 381 阅读 · 0 评论 -
C.Stripe(Codeforces Beta Round #18 (Div. 2 Only))
此题链接单击这里=================思路: 循环n-1次,如果a[1]+….+a[i]==a[i+1]+….+an,就计数一次。#include <iostream>#include <cstdio>#include <queue>#include <stack>#include <string>#include <cstring>using namespace std;原创 2015-08-08 16:20:29 · 479 阅读 · 0 评论 -
卡片游戏(Throwing cards away I,UVa 10935)
此题UVa链接单击这里=================这题做过两遍,这是第二次做,但解法是完全不相同的。上一次的代码已经忘记贴在哪。。。。。。 附代码#include <iostream>#include <vector>#include <cstring>using namespace std;int main(){ int a,i; while(cin>>a&&a原创 2015-07-17 15:23:58 · 517 阅读 · 0 评论 -
Ducci序列(Ducci Sequence ,UVa1594)
此题UVa链接单击这里=================英文对我来说真是一SB,这题足足了一天,后来看他人的解法才想通。 此题的关键就是,在1000次循内找到zero tuple就输出“ZERO”,超过1000次就”LOOP”。 附代码#include <iostream>#include <vector>#include <cmath>#include <cstring>using原创 2015-07-17 11:10:37 · 1635 阅读 · 0 评论 -
Soldier and Bananas( CodeForces - 546A)
此题链接单击这里=================虽然是道简单的题,不注意还是错了。。。。。。 负数时要输出零。。。。。。 错误代码#include <iostream>#include <cmath>using namespace std;int main(){ long n,k,w; cin>>k>>n>>w; for(int i=1;i<=w;i++)原创 2015-07-17 18:54:36 · 855 阅读 · 0 评论 -
Number Sequence(HDU1005)
此题链接单击这里=================以前还不知道有循环节这回事,不进早就用到了。自己进行案例分析找到的循环节是7,然而是错的。。。。。。 高人指点才知道是49,不管数多大n%=49后再 f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7 ,就不会超时。 附代码#include <iostream>using namespace std;in原创 2015-07-18 15:52:42 · 407 阅读 · 0 评论 -
Maximum Product(UVa 11059)
此题链接单击这里=================求最大连续乘积,分别以每个数为起点。连续乘起点数后的数,每乘一个数判断一次(中间变量存储大的数),最后输出中间变量。#include<iostream>#include<cstdio>using namespace std;int main(){ int N, l = 0; while (cin >> N&&N) {原创 2015-07-31 10:44:03 · 457 阅读 · 0 评论 -
Prime Ring Problem(UVA 524)
此题链接单击这里=================用回溯法解此题#include <iostream>#include <cstdio>using namespace std;int a[20];int n;bool is1(int k){ for (int i = 2; i < k; i++) if (k%i == 0) return f原创 2015-07-31 10:51:28 · 328 阅读 · 0 评论 -
Equivalent Strings(Codeforces Round #313 (Div. 2) D)
此题链接单击这里=================#include <iostream>#include <string>#include <vector>using namespace std;string a,b;bool funt(int fa,int la,int fb,int lb){ int i,j; for(i=fa,j=fb;i<la;i++,j++)原创 2015-07-31 18:57:59 · 300 阅读 · 0 评论 -
Power Calculus(POJ 3134)
此题链接单击这里=================#include <iostream>using namespace std;int a[1010];int t,b,n;bool funt(int c){ if(c>t) return false; if(a[c]==n) return true; if(a[c]<=0||a[c]>原创 2015-07-31 19:10:24 · 394 阅读 · 0 评论 -
棋盘问题(POJ 1321)
此题链接单击这里=================看似像八皇后问题,但区别还是很大。 附代码#include <iostream>#include <cstring>using namespace std;char a[10][10];int b[10][10];int n,k,m;bool is(int ax,int ay){ for(int i=1;i<=ax;i++原创 2015-08-02 18:26:15 · 334 阅读 · 0 评论 -
Oil Deposits(UVA 572)
此题链接单击这里=================求有多少个连续的区域,DFS的基础运用。#include <iostream>using namespace std;int m,n;char a[120][120];//int b[120][120];int b[8][2]={-1,-1,0,-1,1,-1,1,0,1,1,0,1,-1,1,-1,0};void funt(int x原创 2015-08-02 18:40:32 · 339 阅读 · 0 评论 -
Codeforces Round #327 (Div. 2)B. Rebranding
B. Rebrandingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe name of one small but proud corporation c原创 2016-05-29 12:36:53 · 406 阅读 · 0 评论