ICode9

精准搜索请尝试: 精确搜索
  • 1031 Rinne Loves Graph 求经过k个障碍到达n的最短路 分层图或最短路+dp2022-08-23 17:01:19

     链接:https://ac.nowcoder.com/acm/contest/26077/1031来源:牛客网 题目描述 Island 发生了一场暴乱!现在 Rinne 要和 Setsuna 立马到地上世界去。 众所周知:Island 是有一些奇怪的城镇和道路构成的(题目需要,游戏党勿喷),有些城镇之间用双向道路连接起来了,且

  • 1031 石子合并 区间DP 前缀和 无环2022-07-12 04:31:06

    链接:https://ac.nowcoder.com/acm/problem/51170来源:牛客网 题目描述 设有N堆沙子排成一排,其编号为1,2,3,…,N1,2,3,\dots ,N1,2,3,…,N(N≤300)(N\leq 300)(N≤300)。每堆沙子有一定的数量,可以用一个整数来描述,现在要将这N堆沙子合并成为一堆,每次只能合并相邻的两堆,合并的

  • PAT乙级 1031 查验身份证 (15 分)2022-02-28 12:01:40

    一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下: 首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值: Z:0 1 2 3 4 5 6 7 8 9 10 M:1 0 X 9 8 7 6 5 4 3 2

  • 1031. Hello World for U (20)2022-01-23 22:04:05

    1031. Hello World for U (20) 题目大意 用所给字符串按U型输出。n1和n3是左右两条竖线从上到下的字符个数,n2是底部横线从左到右的字符个数。 要求: n1 == n3n2 >= n1n1为在满足上述条件的情况下的最大值 基本思路 假设n = 字符串长度 + 2,因为2 * n1 + n2 = n,且要保证n2 >= n1

  • 1031 查验身份证2022-01-04 21:07:10

    一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下: 首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值: Z:0 1 2 3 4 5 6 7 8 9 10 M:1 0 X 9 8 7 6 5 4 3 2

  • 1031:反向输出一个三位数2021-12-19 17:00:54

    【题目描述】 将一个三位数反向输出,例如输入358,反向输出853。 【输入】 一个三位数n。 【输出】 反向输出n。 【输入样例】 100 【输出样例】 001 #include <iostream> using namespace std; int main() { int n; cin >> n; cout << n % 10 << (n % 100) / 10

  • 题目 1031: [编程入门]自定义函数之字符串反转2021-11-01 23:04:39

    题目描述 写一函数,使输入的一个字符串按反序存放,在主函数中输入并输出反序后的字符串(不包含空格)。 输入 一行字符 输出 逆序后的字符串 样例输入 123456abcdef 样例输出 fedcba654321 package parctice; import java.util.Scanner; public class ph1031 { public static voi

  • 输出绝对值(YZOJ-1031)2021-10-08 09:05:49

    【问题描述】 输入一个浮点数,输出这个浮点数的绝对值。 【输入格式】 输入一个浮点数,其绝对值不超过10000。 【输出格式】 输出这个浮点数的绝对值,保留到小数点后两位。 【样例输入】 -3.14 【样例输出】 3.14 【参考程序】 #include<bits/stdc++.h> using namespace std;

  • 1031 查验身份证2021-10-07 15:34:03

    一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下: 首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值: Z:0 1 2 3 4 5 6 7 8 9 10 M:1 0 X 9 8 7 6 5 4 3

  • 1031 Hello World for U (20 分)2021-09-17 21:00:03

    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 printed in the original order, starting top-down from the l

  • 1031 查验身份证 (15 分)2021-08-04 20:01:24

    1031 查验身份证 (15 分) 一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下: 首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值: Z:0 1 2 3 4 5 6 7 8 9 10 M:1

  • pat甲级 1031 Hello World for U2021-04-07 17:35:41

    题目: 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 lowo That is, the characters must be printed in the original order, starting top-down from the

  • pat 乙级 1031 查验身份证(C++)2021-02-16 20:06:12

    题目 一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下: 首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值: Z:0 1 2 3 4 5 6 7 8 9 10 M:1 0 X 9 8 7 6 5

  • pat甲级10312021-02-15 23:33:10

    pat1031 #include<iostream> #include<cmath> using namespace std; int main(){ string s; cin>>s; int n1,n2; n2=ceil(s.length()+2)/3; while(n2<3||(s.length()-n2)%2!=0||(s.length()-n2+2)/2>n2) n2++; n1=(s.length()-n2)/2; for(in

  • pat-10312021-02-06 19:29:03

    #include<bits/stdc++.h> using namespace std; char vv[100][100]; int main(){ string a; cin>>a; fill(vv[0],vv[0]+100*100,' '); int n=a.size()+2; int k=n/3; int bot=a.size()-k*2,cnt=0;//应该是a。size()才对不是修饰过的n for(int i=0;i<k;i+

  • 1031 Hello World for U (20分)2021-01-30 22:35:34

    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 lowo   That is, the characters must be printed in the original order, starting top-down from the l

  • 1031 查验身份证 (15point(s))2020-12-10 20:58:53

    1031 查验身份证 (15point(s)) 一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下: 首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值: Z:0 1 2 3 4 5 6 7

  • PAT 乙级 1031 查验身份证 (15分)2020-11-26 18:32:25

    #include<iostream> #include<string> using namespace std; int main(){ int n, sum, flag ; cin >> n; string s; int a[17] = { 7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2 }; int num = 0; char c[11] = { '1','0','

  • 1031 Hello World for U (20分)2020-09-20 10:31:22

    1031 Hello World for U (20分) #include <iostream> #include <string.h> using namespace std; int main() { char c[81], u[30][30]; memset(u, ' ', sizeof(u)); scanf("%s", c); int n = strlen(c) + 2; int n1 = n

  • 1031 Hello World for U2020-06-15 14:59:03

    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 lowo   That is, the characters must be printed in the original order, starting top-down from the

  • PAT字符串处理题---1031 查验身份证 (15分)2020-06-10 10:51:52

    1031 查验身份证 (15分) 把不符合的输出 没有就输出All passed #include<iostream> #include<ctype.h> #include<sstream> #include<string> #include<cstdio> const int maxn=110; using namespace std; int cnt=0; string s[maxn]; int weight[]={7,9,10,5

  • 1031 Hello World for U (20分)2020-03-26 16:57:40

      第一次做图形打印的题。懵逼。找其他人的解法来学习。意外的发现string有substr()这个好工具。 字符串长度设为len,n=n+2。令 n/3=n1 。把n平均分成三份,n1为截取商的部分, n2=n/3+n%3 ,余数部分全给n2。这使得n1已经尽可能的大,至多与n2相等,这是题目的要求。n2的另一种表达方

  • PAT A 1031 Hello World for U2020-03-06 18:38:31

    #include <iostream> #include<stdio.h> #include<string.h> using namespace std; int main() { char str[100]; scanf("%s",str); int len=strlen(str); int n1,n2,n=0,i=1; while(3*i<=len+2) i++; n1=i-1; n

  • 1031 Hello World for U (20分)2019-12-08 16:02:27

    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 lowo That is, the characters must be printed in the original order, starting top-down from the lef

  • 1031 笔记2019-11-02 17:52:19

    目录 pymysql 1.基本操作 1.新建表 2.增加数据 3.删除数据 4.更改数据 5.查找数据 6.断开连接 2.sql注入 解决方法 3.创建大数据库 索引 定义 作用 实现原理 B+树的性质 B+树的分类 InnoDB存储引擎表示索引组织表,即表中数据按照主键顺序存放。而聚集索引(clustered index)就

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

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

ICode9版权所有