ICode9

精准搜索请尝试: 精确搜索
  • poj 3589(水题)2021-08-18 02:02:20

    #include<iostream> #include<cstdio> using namespace std; int main(){ int t,ansa,ansb,data[5],target[5]; char a[5],b[5]; scanf("%d",&t); while(t--){ ansa = ansb = 0; scanf("%s%s",a,b);

  • 【YBTOJ】【POJ 1821】Fence2021-08-17 13:34:30

    题目大意: 有 \(n\) 块木板从左到右排成一行,有 \(m\) 个工匠对这些木板进行粉刷,每块木板至多被粉刷一次。 第 \(i\) 个木匠要么不粉刷,要么粉刷包含木板 \(S_i\) 且长度不超过 \(L_i\) 的连续的一段木板,每粉刷一块可以得到 \(P_i\) 的报酬。不同工匠的 \(S_i\) 不同。 请问如何安排

  • poj 1042(分类讨论,模拟)2021-08-14 20:03:28

    #include<iostream> #include<cstring> #include<cstdio> using namespace std; int main(){ int i,j,k,n,h,h_t,f[30],d[30],sheng[30],t[30],ans_t[30][30],sum_fish[30]; int st,sum_t,sum_fish_t,sum_fish_i,tmp,tmp_i; while(scanf("

  • poj 2136(水题)2021-08-13 19:03:37

    #include<iostream> #include<cstdio> #include<cstring> using namespace std; int main(){ int i,j,col,data[30],ans[30][305],pos[305]; char a[4][100]; memset(data,0,sizeof data); for(i=0;i<4;i++){ gets(a[i]);

  • POJ-2586 Y2K Accounting Bug(贪心)2021-08-11 20:34:59

    题目传送门 题意   一家公司,如果盈利,则金额为\(s\),如果亏损,则金额为\(d\),该公司每连续五个月公布一次总财报,已知公布的八次财报全为亏损,问是否盈利,如果盈利则输出最多能盈利的金额,否则输出\(Deficit\)。 思路   这题主要的困难在于理解题目的题意,连续五个月说明是在\(1、234

  • poj 3278(bfs模板题)2021-08-11 17:02:10

    #include<iostream> #include<queue> #include<cstring> #include<cstdio> using namespace std; int n,k,ans; int data[100005]; void bfs(){ memset(data,-1,sizeof data); queue<int>q; q.push(n); data[n] = 0; while

  • poj 3984(模板题,bfs)2021-08-11 12:34:09

    #include<iostream> #include<cstring> #include<cstdio> #include<queue> using namespace std; struct Node{ int x,y; Node(){ x = 0; y = 0; } Node(int a,int b){ x = a; y = b; } }; int

  • poj 3979(水题)2021-08-10 21:33:03

    #include<iostream> #include<cstdio> #include<cstring> using namespace std; int gcd(int a,int b){ int t; if(a==0)return b; while(b){ t = a%b; a = b; b = t; } return a; } int main(){ int t,a,

  • poj 1953(斐波那契通项公式解法)2021-08-09 16:31:06

    #include<iostream> #include<cmath> #include<cstdio> using namespace std; int main(){ int t,i,kase; long long n; double ans; scanf("%d",&t); kase = 1; while(kase<=t){ scanf("%lld"

  • poj 1702(三进制计算)2021-08-09 14:33:13

    #include<iostream> #include<cstring> #include<cstdio> using namespace std; int main(){ int i,t,w,a[25],data[25],ans[25],dd,len,count; bool flag; scanf("%d",&t); for(i=0,dd=1;i<20;i++,dd*=3){ data[

  • POJ-1753Flip Game 枚举2021-08-08 15:00:19

    题目传送门 题意   给定一个\(4\times4\)的棋盘,棋子要么为白色要么为黑色,现在每次可以选择一个棋子,同时翻转该棋子以及与其相邻的四个棋子,要求将所有棋子都翻转成同一种颜色,问是否存在这种情况,如果存在,输出最少的翻转步数,否则输出\(Impossible\)。 思路   对于每个棋子来说,只

  • poj 1700(水题,找规律)2021-08-05 19:31:53

    #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int i,t,n,data[1005],ans,x,y; scanf("%d",&t); while(t--){ scanf("%d",&n); for(i=0;i<n;i++

  • poj 3083(不是特别难,但是很麻烦)2021-08-05 12:34:59

    #include<iostream> #include<cstdio> #include<cstring> using namespace std; int k,t,w,h,sx,sy,sum,ex,ey; int idx[45][45],data[45][45],ans[3]; char c[45][45]; void print(){ for(int i=0;i<h;i++){ for(int j=0;j<w;j++){

  • 图论题集5002021-08-04 22:33:43

    转载:https://blog.csdn.net/luomingjun12315/article/details/47438607 =============================以下是最小生成树+并查集======================================【HDU】1213 How Many Tables 基础并查集★1272 小希的迷宫 基础并查集★1325&&poj1308 Is It A Tre

  • POJ 2750 Potted Flower2021-08-04 01:33:30

    传送门 大半年时间没练习,已经什么也不会了 == 为了维护区间最大子区间和,容易想到线段树区间合并,需要维护包含左/右端点的最大子区间和。 至于环状结构,可以通过二选一来等价得到答案,因此还需要维护区间最小子区间和。 注意特判不能全选。 #include <algorithm> #include <cstdio> #

  • poj 1027(dfs,偏向实际应用)2021-08-03 21:34:34

    #include<iostream> #include<cstring> #include<cstdio> using namespace std; char c[10][20]; int data[10][20],idx[10][20],k,score; struct Node{ int x,y,sum,mscore; char c; }move[100]; void print(){ int i,j; for(i=0;i<10

  • poj 1020(回溯+dfs)2021-08-03 01:00:13

    #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> using namespace std; int d[11],n,s,visit[50]; bool dfs(int num){ int i,j,wide; if(num==n)return true; int pos; int minx = 100; for(j=1;j&

  • POJ - 1556 The Doors(计算几何 + 最短路)2021-08-02 23:00:44

    链接 The Doors 题意 从 ( 0 , 5 ) (0,5) (0,5) 位置走到

  • poj 1102(水题)2021-08-02 12:06:09

    #include<iostream> #include<cstdio> #include<cstring> using namespace std; int main(){ int s,len,p,i,j,k; char n[10],d[25][100]; while(scanf("%d%s",&s,n)!=EOF,s){ len = strlen(n); for(i=0;i<le

  • poj 1047(大数乘法,类似1001)2021-08-02 01:01:11

    #include<iostream> #include<cstring> #include<cstdio> using namespace std; const int maxn = 65; int d[10],p[10]; char a[maxn]; int t[maxn]; bool flag; void init(){ memset(d,0,sizeof(d)); for(int i=0;i<strlen(a);i++) d

  • poj 3664(水题,结构体排序)2021-08-01 22:31:47

    #include<iostream> #include<algorithm> using namespace std; struct Node{ int id,a1,a2; }vote[50005]; bool cmp(struct Node v1,struct Node v2){ return v1.a1>v2.a1; } int main(){ int n,k,ans,ansi; scanf("%d%d",&n,

  • poj 3637(水题)2021-08-01 22:00:23

    #include<iostream> #include<algorithm> #include<cstdio> using namespace std; bool cmp(int a,int b){ return a>b; } int main(){ int t,n,a[20005]; scanf("%d",&t); while(t--){ scanf("%d",&am

  • poj 3365(数学,分段函数)2021-08-01 21:00:25

    #include<iostream> #include<cstdio> #include<cmath> using namespace std; const double PI = 3.141592653589; int main(){ double w,h,v1,v2,v3,v4,x; while(scanf("%lf%lf",&w,&h)!=EOF&&w){ v1 = 0;v2 =

  • poj 3292(筛素数法变形)2021-08-01 17:04:18

    #include<iostream> #include<cmath> #include<cstring> #include<cstdio> #include<algorithm> #include<ctime> #define ll long long using namespace std; const int maxn = 1000005; int data[maxn],data2[maxn]; bool flag[maxn];

  • POJ - 1276 Cash Machine2021-08-01 14:32:07

    Cash Machine POJ - 1276 AYIT-2021 609暑假集训第一周下 记忆化搜索和背包 A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denomi

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有