ICode9

精准搜索请尝试: 精确搜索
  • 1005 继续(3n+1)猜想(C#)2021-05-19 10:51:26

    一、题目内容: 卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对 n=3 进行验证的时候,我们需要计算 3、5、8、4、2、1,则当我们对 n=5、8、4、2 进行验证的时

  • POJ - 1005 I Think I Need a Houseboat2021-05-07 17:04:50

    POJ 1005 - I Think I Need a Houseboat Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking by 50 square miles

  • 背包问题2021-04-26 15:01:34

    AcWing模板 背包问题 背包问``题 /*dp[][];*/ /*dp[][];*/ #include<iostream> using namespace std; int dp[1005][1005]; int v[1005],w[1005]; int main() { int n,m; cin>>n>>m; for(int i = 1;i <= n;i++) cin>>v[i]>>w[i]; for

  • PAT乙级1005题目详解2021-04-23 21:58:11

    1005 继续(3n+1)猜想 (25分) 卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对n=3进行验证的时候,我们需要计算 3、5、8、4、2、1,则当我们对n=5、8、4、2

  • PTA 1005 继续(3n+1)猜想 c++实现2021-04-22 21:58:55

    PTA 1005 继续(3n+1)猜想 c++实现 卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对 n=3 进行验证的时候,我们需要计算 3、5、8、4、2、1,则当我们对 n=5、

  • 【JZOJ】1005:【入门】输入一个三位数,把个位和百位对调后输出2021-04-17 14:29:25

    链接 题目描述 输入一个三位自然数,然后把这个数的百位数与个位数对调,输出对调后的数 输入 输入一行,只有一个整数x(100<=x<=999)。 输出 输出只有一行,包括1个整数。 样例 输入 123 输出 321 其实这道题说是“百位数与个位数对调”,其实就是三位数倒序,这与1004很像,都是拆数,都

  • CCF CSP认证mine历年解题记录2021-04-10 16:32:10

    201909-01 小明种苹果 100分代码:    #include<cstdio> #include<algorithm> #define N 1005 #define M 1005 int n,m; int a[N+1][M+3]={0}; //最后一列用来保存这棵树的疏果总数 ,序号和行数对应,第一列和第一行不保存数据 int T=0,k; int P=0; int main(){

  • 1005 Spell It Right (20 分)2021-04-06 14:03:02

    1005 Spell It Right (20)(20 分) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains one test case. Each case occupies one line w

  • 贪心算法2021-04-03 23:32:22

    P1223 排队接水 要使得后面等待的时间少,那么就是要尽量让接水时间短的人排在前面。 按照接水所需时间从小到大排序,即为接水的顺序。 注意算平均值的时候不要把最后一个人的接水时间也加上。 \(AC code\) #include<bits/stdc++.h> using namespace std; long long a,b[1005],c[100

  • 10052021-03-27 11:01:18

    #include<iostream> #include<algorithm> using namespace std; int main() { int n = 0,i=0,count =0; int contrast1[10000] = {1,2}; //如果数组长度小了运行时可能出现错误 cin >> n; int* num = new int[n]; int* ctrlc = new int[n]; for (int i = 0; i <

  • 弹珠游戏--嘴平乔治猪的刷题整理2021-03-14 22:57:35

    文章用于本人的刷题整理,如有大佬留下宝贵建议,本人将不胜感激。 题目 https://www.luogu.com.cn/problem/P2356 本题一开始想的方法就是直接暴力枚举。 #include<bits/stdc++.h> using namespace std; int n; int a[1005][1005] = {0}; int ss(int x, int y) { int sum = 0;

  • 2017-2018 ACM-ICPC, NEERC, Moscow Subregional Contest Problem G2021-03-14 02:01:36

    题目链接 每个格子都是一个未知数,每条边都能列出一个方程 于是得到了一个 \(2mn \times mn\) 的线性方程组 一开始以为是超定,后来举了个例子,发现是亚定。 发现每个未知数都分别在四个方程中出现,两次系数为1,两次为-1,那我们正负两两相加,这个变量就被消掉了,这就成了一个自由变量。

  • 1003 Emergency (25 分)2021-03-10 09:58:56

    As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are mark

  • 01背包问题2021-03-08 23:01:23

    题目: 题解: #include <bits/stdc++.h> using namespace std; int v[1005],w[1005]; int f[1005][1005]; int main() { int n,m; cin>>n>>m; for(int i=1;i<=n;i++) cin>>v[i]>>w[i]; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j

  • 背包问题-完全背包-初步化简2021-03-08 20:59:01

    模板题解 #include <iostream> #include <algorithm> #include <cstring> #include <math.h> using namespace std; int main(){ int N=0, V=0, v[1005], w[1005]; int dp[1005][1005]; cin >> N >> V; for(int i=1; i<=N; ++i){ c

  • AcWing-2背包问题2021-03-07 14:04:14

    题目链接:https://www.acwing.com/problem/content/2/ 题目描述:     解题思路:《算法图解》中的贪心、背包问题        先创建一个表格(n+1)*(m+1)的一个空表(二维数组表示list[n][m])并初始化为0,       假设每次只能按输入的顺序将物品放入背包(只是不能去放当前物品

  • [BZOJ]1005 [HNOI2008]明明的烦恼2021-03-07 08:34:32

    题意 一棵树,给定每个点的度数,\(-1\)为无限制,求满足该度数的树的个数。 题解 prufer序列的裸题。 关于prufer序列,网上有更加详细的介绍,这里就不展开说明了,只介绍跟该题相关的性质。 所有无根树可以跟prufer序列形成双射。 一棵无根树,每个点在prufer序列出现的次数为它的度数减一。

  • [NOIP2001 普及组] 数的计算2021-02-21 14:02:02

    题目链接 题目描述 我们要求找出具有下列性质数的个数(包含输入的正整数 n)。 先输入一个正整数 n(n≤1000),然后对此正整数按照如下方法进行处理: 不作任何处理; 在它的左边加上一个正整数,但该正整数不能超过原数的一半; 加上数后,继续按此规则进行处理,直到不能再加正整数为

  • PTA 1005 拼写正确2021-02-16 16:31:48

    目录 问题描述思路分析及代码实现 问题描述 Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains one test case. Each case occ

  • HDU 1005 Number Sequence2021-02-15 10:30:12

    题目大意: 求一个类斐波那契数列的某一项值。 解题思路: 打表找规律: 发现 48 为 循环节点 AC代码: #include <iostream> #include <cstring> #include <algorithm> #include <cmath> #include <map> #include <cstdio> using namespace std; typedef long long ll; //ll pow(l

  • 2021/2/92021-02-09 18:32:58

    这几天在学动态规划,先没弄懂怎么把一个问题合理的划分成子问题,先记录一下这几天做的几个题 1. 这道题的实质就是求最长递减子序列 这个思路就是 我们从第一个数开始以次求出以他结尾的最长子序列最求看最大是哪个。 我们用一个数组dp来记录最大递减子序列,dp【i】表示以第i个

  • 1143. 最长公共子序列2021-02-06 18:01:03

    class Solution { public: int f[1005][1005]; int longestCommonSubsequence(string text1, string text2) { memset(f,0,sizeof(f)); int n=text1.size(); int m=text2.size(); for(int i=1;i<=n;i++) for(int j=1;

  • 1005:地球人口承载力估计2021-02-06 11:03:06

    1005:地球人口承载力估计 描述 假设地球上的新生资源按恒定速度增长。照此测算,地球上现有资源加上新生资源可供x亿人生活a年,或供y亿人生活b年。 为了能够实现可持续发展,避免资源枯竭,地球最多能够养活多少亿人? 输入 一行,包括四个正整数x,a,y,b,两个整数之间用单个空格隔开。x > y,a < b,a

  • A-1005 Spell It Right (20 分)2021-02-03 19:01:04

    A-1005 Spell It Right (20 分) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains one test case. Each case occupies one line w

  • 最长不下降子序列2021-02-01 18:01:44

    样例输入 10 3 18 7 14 10 12 23 41 16 24 样例输出 6 #include <stdio.h> int a[1005], dp[1005]; int main() { int i, j, l, max; int n; scanf("%d",&n); for(i = 1; i <= n; i++){ scanf("%d",&a[i]);

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

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

ICode9版权所有