ICode9

精准搜索请尝试: 精确搜索
  • 解决本地代理问题 git 或者 curl Failed to connect to 127.0.0.1 port 1087 after 8 ms: Connection refused2022-05-10 21:01:31

    问题出现原因 git配置了代理 本地配置了代理 执行这个命令可以看到自己的代理设置: env | grep -I proxy 临时更改代理 在当前终端执行以下命令,就可以临时将代理取消掉 export http_proxy="" export https_proxy="" 取消代理设置 方式一:通过 git 取消代理设置 git config --glo

  • 【专题复习4:Dijkstra】1003、1018、1030、1072、1087、11112022-03-01 21:32:07

    1003 1003 点击查看代码 #include <bits/stdc++.h> using namespace std; const int INF=999999999; int n,m,c1,c2; int e[510][510],weight[510],w[510]; int d[510],num[510]; bool vis[510]; void Dijkstra(int s) { fill(d,d+510,INF); d[s]=0; w[s]=weigh

  • PAT (Basic Level) Practice 1087 有多少不同的值 (20 分)2022-02-01 22:01:20

    题目:1087 有多少不同的值 (20 分) 来源:PAT (Basic Level) Practice 传送门 1087 有多少不同的值 题面 题意:输出题目中算式不同答案的个数 思路:见代码 Code 点击查看代码 #include <bits/stdc++.h> using namespace std; int num[20000]; int main(){ int n,ans=0,k; c

  • AcWing 1087. 修剪草坪2022-01-17 08:31:11

    题目传送门 一、题目描述 给定一个长度为 \(n\) 的数组 \(w\),其中 \(w_i\) 是第 \(i\) 个元素的 贡献 我们可以选择的 数组 中的一些 元素,这些元素的 贡献总和 表示我们该种 方案 的 价值 但是,如果方案中出现选择了 连续相邻 且超过 \(m\) 个元素,则这些 连续相邻 的元素 贡献 归零

  • PAT乙级10872021-10-27 09:32:03

    #include<set> #include<iostream> using namespace std; int main() { set<int> v; int n; cin>>n; int sum=0; for(int i=1;i<=n;i++){ sum=i/2+i/3+i/5; v.insert(sum); } cout<<v.size();

  • PAT Basic Level 1087 有多少不同的值 解题思路及AC代码 v1.02021-10-02 14:33:38

    PAT 乙级 1087 有多少不同的值 1. 题目简述及在线测试位置2. 基本思路3. 完整AC代码 1. 题目简述及在线测试位置 1.1 给定数字N,从1到N依次代入到:i/2 + i/3 + i/5 ,统计可以得到多少不同的数字 1.2 在线测试位置: 1087 有多少不同的值 2. 基本思路 2.1 本题的难点是如何

  • 【Dijstra+平均点权和最大+路径】1087 All Roads Lead to Rome (30 分)2021-09-30 00:01:59

    1087 All Roads Lead to Rome (30 分) Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness. Input Specification: Each input file contains

  • 1087 有多少不同的值2021-09-21 19:34:24

    当自然数 n 依次取 1、2、3、……、N 时,算式 ⌊n/2⌋+⌊n/3⌋+⌊n/5⌋ 有多少个不同的值?(注:⌊x⌋ 为取整函数,表示不超过 x 的最大自然数,即 x 的整数部分。) 输入格式: 输入给出一个正整数 N(2≤N≤10 4 )。 输出格式: 在一行中输出题面中算式取到的不同值的个数。 输入样例: 2017 输

  • 1087 有多少不同的值 (20 point(s))2021-09-21 14:00:36

    刚开始没有确定题意,感觉应该是对通过算式得到的值标记,然后统计这些标记了的值。所以开了一个 vis 数组,存放这个值是否出现过。第一次出现就 ++ 统计个数。 但最开始的时候只是把数组大小定义为 2017 稍微试试样例的结果。但发现结果有问题,算出的值小于样例给出的 1480 而只有 14

  • 1087.Brace-Expansion (prime)2021-09-09 14:02:25

    package LeetCode_1087 /** * 1087.Brace-Expansion (prime) * https://leetcode.com/problems/brace-expansion/ * * A string S represents a list of words. Each letter in the word has 1 or more options. * If there is one option, the letter is represented a

  • 1087 All Roads Lead to Rome (30 分)2021-09-06 14:30:48

    1087 All Roads Lead to Rome (30 分) Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness. Input Specification: Each input file contains

  • PAT甲级 1087 All Roads Lead to Rome (30 分)2021-09-04 19:33:47

    Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness. Input Specification: Each input file contains one test case. For each case, the fir

  • 用LUA(和C++)刷PAT (Advanced Level) ——1087 All Roads Lead to Rome2021-09-04 16:34:25

    #include <iostream> #include <map> #include <string> #include <vector> #include <cstring> #include <cmath> #include <algorithm> using namespace std; struct city{ string name; int happiness = 0, cumulativ

  • PAT (Advanced Level) Practice 1087 All Roads Lead to Rome (30 分) 凌宸16422021-08-10 19:33:55

    PAT (Advanced Level) Practice 1087 All Roads Lead to Rome (30 分) 凌宸1642 题目描述: Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness.

  • 1087 有多少不同的值 (20 分)2021-07-15 17:02:46

    1087 有多少不同的值 (20 分) 当自然数 n 依次取 1、2、3、……、N 时,算式 ⌊n/2⌋+⌊n/3⌋+⌊n/5⌋ 有多少个不同的值?(注:⌊x⌋ 为取整函数,表示不超过 x 的最大自然数,即 x 的整数部分。) 输入格式: 输入给出一个正整数 N(2≤N≤10​4​​)。 输出格式: 在一行中输出题面中

  • mac git拉取失败 Failed to connect to 127.0.0.1 port 1087: Connection refused2021-06-29 01:03:45

    解决方法: 1. 查看端口是否被占用:lsof -i:1087 若没有返回则没有占用。 2. 查看代理:env|grep -i proxy 返回结果: 结论:使用代理导致访问失败 3. 解决方法:直接输入export ALL_PROXY=""

  • 终端配置代理2021-06-01 11:02:18

    终端配置代理函数 # ------terminal http proxy ---------- function proxy_on() { export http_proxy = http://127.0.0.1:1087 export https_proxy = http://127.0.0.1:1087 echo - e "已开启代理" } function proxy_off() { unset http_proxy unset https

  • PAT 乙级 1087.有多少不同的值 C++/Java2021-05-05 18:01:33

    题目来源 当自然数 n 依次取 1、2、3、……、N 时,算式 ⌊ 有多少个不同的值?(注:⌊ 为取整函数,表示不超过 x 的最大自然数,即 x 的整数部分。) 输入格式: 输入给出一个正整数 N(2)。 输出格式: 在一行中输出题面中算式取到的不同值的个数。 输入样例: 2017   输出样例: 1480   C

  • 20210428# 【MK-java架构师-技术专家】2021-05-05 02:05:07

    上一級: 20210501# 【212-Java】 目录 - 10,657 min = 177.6 hour 阶段一:单体电商项目架构,开发与上线(1~5周)- 1617 阶段二:从单体到高可用集群演进(6-8周)- 1066 阶段三:分布式架构-逐个击破分布式核心问题(9-17周)- 2523 阶段四:基于SpringCloud改造微服务(18-25周)- 2463 阶段五:服务容器化-

  • 1087. 修剪草坪(单调队列优化dp)2021-04-10 23:31:32

    传送门 dp[i]表示以i为结尾的合法方案的最大值 不如i不选,那么最大就是dp[i-1]. 如果选,那么就是i-k到i中选一个最大的j (不选 j 的最大值),然后再答案就是dp[j-1]+sum[i]-sum[j] #define _CRT_SECURE_NO_WARNINGS #include<cstdio> #include<iostream> #include<algorithm> #in

  • 1087 All Roads Lead to Rome (30 分)2021-03-01 23:35:07

    这题水的有点蛋疼。 题意 有N个城市,M条无向边。现在需要从某个给定的起始城市出发(除了起始城市外,其他每个城市都有一一个“幸福值”,前往名为“ROM”的城市。给出每条边所需要消耗的花费,求从起始城市出发,到达城市ROM所需要的最少花费,并输出最少花费的路径。如果这样的路径有多条,则

  • 1087 花括号展开2021-02-11 12:01:39

    题目描述: 我们用一个特殊的字符串 S 来表示一份单词列表,之所以能展开成为一个列表,是因为这个字符串 S 中存在一个叫做「选项」的概念: 单词中的每个字母可能只有一个选项或存在多个备选项。如果只有一个选项,那么该字母按原样表示。 如果存在多个选项,就会以花括号包裹来表示这

  • pat 1087 最短路2021-01-10 16:35:49

    #include<algorithm> #include<map> #include<vector> #include<string> #include<iostream> #include<stack> using namespace std; #define max 203 #define inf 0x3f3f3f3f int dis[max][max]={0}; int n=0; int visited[max]={0};

  • PAT(Basic Level) Practice : 1087 有多少不同的值 (20分)2020-10-01 02:00:25

    1087 有多少不同的值 (20分) 测试点3段错误 n=10000时,结果为10333 建立大数组的时候要大于这个数 代码 #include <iostream> #include <vector> #include <string> #include <cstdio> //scanf printf防止超时 #include <algorithm> //vector的sort #include <sstream> //转换 usin

  • 终端配置kxsw2020-07-18 11:01:09

    浏览器见:https://docs.qq.com/doc/DZEZuU3hCaE9ZbUlw   终端配置代理 在命令行输入执行以下两条指令 export http_proxy=http://127.0.0.1:1087 export https_proxy=http://127.0.0.1:1087 macOS 版的 SS 默认监控本地的HTTP端口是 1087,而 Windows 版本的则是 1080,如果改过默

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

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

ICode9版权所有