PAT 1031 代码及坑点
原创 2022-01-28 15:13:26
74阅读
1 class Solution(object): 2 def getMaxByCount(self,A,maxlen): 3 curmax = 0 4 curmax = sum(A[:maxlen]) 5 bigmax = curmax 6 n = len(A) 7 for i in rang
转载 2019-04-21 12:41:00
5阅读
题目链接:热浪 题意就是给你一堆路径,然后让你找某两个点之间的最短路,然\
原创 2022-08-31 10:35:38
32阅读
1031. Hello World for U (20)时间限制400 ms内存限制65536 kB代码长度限
原创 2022-08-30 10:19:17
31阅读
1031 质数环 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 1031 质数环 1031 质数环 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Go
原创 2021-06-04 20:08:56
221阅读
1031. 查验身份证(15)时间限制200 ms内存限制65536 kB代码长度限制800
原创 2022-08-30 10:05:38
33阅读
#include<iostream> #include<vector> #include<map> #include<queue> #include<string> #include<cstring> using namespace std; const int MAXN = 205; const int INF = 1000000; int dis[MAXN]; int n;//结点数量 typedef pair<int,int> pii; struct edge//建立边的结构体 { int v; //v表
转载 2011-07-04 18:37:00
28阅读
URAL_1031     dp的方程还是很好写的,但如果用裸的O(N^2)的dp的话应该会超时(不过后来翻解题报告的时候有人说O(N^2)也可以过),于是要优化dp的过程。     既然维数已经是一维了,不妨去着眼优化决策的过程,于是猜想到可能费用随着距离的增加是单调递增的(不过即便不是单调递增的,根据dp的方程我们也依然可以用单调队列进行优化),下面就来证明这一点。     设由x出发到y、z
转载 2012-05-03 10:48:00
46阅读
2评论
对于一个数n,如果是偶数,就把n砍掉一半;如果是奇数,把n变成 3*n+ 1后砍掉一半,直到该数变为1为止。 请计算需要经过几步才能将n变到1,具体可见样例。 测试包含多个用例,每个用例包含一个整数n,当n为0 时表示输入结束。(1<=n<=10000) 对于每组测试用例请输出一个数,表示需要经过的
转载 2018-10-02 11:00:00
42阅读
2评论
Given any string of N (≥) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l l r
转载 2020-06-15 14:48:00
70阅读
题目题意:给定字符串,按照U的形式输出。#include<iostream>using namespace std;int main(
原创 5月前
48阅读
题意: 把字符串变成U型,左边n1个,右边n3个,底部n2个。 主要是理解这一句:  n1 = n3 = max { k| k 2 for all 3 2 <= N } with n1 + n2 + n3 - 2 = N. 这句话的意思是 1. n1等于n3,  2. 对于3n1 + n2 + n3 - 2 = N 3.从k n1 而n
原创 2022-09-26 10:00:03
30阅读
出错信息:ORA-1031 signalled during: create tablespace 表空间名 datafile '+DATA' size 10M autoextend on next 5M maxsize unlimited...问题描述新部署的oracle环境,有一个需求在designer用户下每天凌晨1点job调用存储过程创建表空间。该用户已经有connect,resource
原创 2014-09-12 21:51:19
1705阅读
#include <iostream>#include <algorithm>#include <cstdio>using namespace std;int a[109];int b[109];int main(){ int n,i,s=0,t,c=0; scanf("%d",&n); for(i
转载 2018-11-18 19:00:00
144阅读
2评论
Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, "helloworld" can be printed as: h d e l l r lowo That is, the characters must be pr
原创 2月前
48阅读
一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下: 首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值: 现在给定一些身
转载 2019-05-18 10:06:00
107阅读
2评论
思路:最短路裸题#includeusing namespace std;const int maxn = 250
原创 5月前
24阅读
1031 查验身份证 (15 分)一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则
原创 2022-07-07 16:08:25
99阅读
题目#include<iostream>#include<string>#include<vector>using namespace std;int main() { int weight[17]= {7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2} ; string check="10X98765432"; in...
原创 5月前
63阅读
  • 1
  • 2
  • 3
  • 4
  • 5