ICode9

精准搜索请尝试: 精确搜索
  • 【算法练习】字符串处理 poj2925:大整数的因子2019-08-24 18:44:12

    题目链接:http://bailian.openjudge.cn/practice/2925 2925:大整数的因子 总时间限制:  1000ms 内存限制:  65536kB 描述 已知正整数k满足2<=k<=9,现给出长度最大为30位的十进制非负整数c,求所有能整除c的k。 输入 一个非负整数c,c的位数<=30。 输出 若存在满足 c%k == 0 的k,从

  • PAT 甲级 1027 Colors in Mars (20 分)(进制转换)2019-08-18 14:03:31

    1027 Colors in Mars (20 分)   People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, a

  • 剑指offer(Java实现)17 - 打印从1到最大的n位数2019-08-13 09:05:40

    输入数字 n,按顺序打印出从 1 最大的 n 位十进制数。比如输入3,则打印出1、2、3一直到最大的3位数即 999。 思路: 考虑大数问题,使用字符串代替数字。 class Solution{ public void print1ToMaxOfNDights1s(int n) { if (n <= 0) return; char[] d

  • 2019牛客暑期多校训练营(第六场) Is Today Friday?2019-08-07 12:04:45

    时间限制:C/C++ 5秒,其他语言10秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 No, it's not Friday :(  TangTang loves Friday and he has made up a list of n days which are all Friday! Each date in this list is formed as "yyyy/mm/dd",

  • POJ 3050 Hopscotch 四方向搜索2019-08-03 17:57:11

      Hopscotch Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6761   Accepted: 4354 Description The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, th

  • Python随机生成密码2019-07-31 21:56:37

    废话不说,直贴代码 # coding:utf-8 """ Author : han Email : oaixnah@163.com Time : 2019-07-27 17:12 Home Team : Golden State Warriors 随机生成 密码 6位 ~ 20位 三个等级 """ import sys import random

  • 练习3-4 统计字符 (15 分)2019-07-29 18:00:29

    本题要求编写程序,输入10个字符,统计其中英文字母、空格或回车、数字字符和其他字符的个数。 输入格式: 输入为10个字符。最后一个回车表示输入结束,不算在内。 输出格式: 在一行内按照 letter = 英文字母个数, blank = 空格或回车个数, digit = 数字字符个数, other = 其他字符

  • FPGA实现二进制转BCD码2019-07-22 22:02:16

    Verilog代码: module Binary_to_BCD #(parameter INPUT_WIDTH, parameter DECIMAL_DIGITS) ( input i_Clock, input [INPUT_WIDTH-1:0] i_Binary, input i_Start, // output [DECIMAL_DIGITS*4-1:0] o_BCD, output

  • C语言程序设计现代方法第二版 8.32019-07-19 18:00:51

    #define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdbool.h> int main(){ int digit; long n; while (true) { bool digit_seen[10] = { false }, flag = false; printf("Enter a number: "); scanf("%ld", &n

  • A - Rightmost Digit2019-07-17 23:04:09

      思路: 运用快速幂。   代码: #include <iostream>#include <stdio.h>using namespace std;typedef long long LL;void quick_pow(int x){ int ans = 1, y = x; x = x % 10; while (y) { if (y & 1) ans = (ans * x) % 10; y &g

  • Backward Digit Sums POJ - 31872019-07-16 18:02:36

    FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one fewer number. They repeat this until only a single number is left. Fo

  • 剑指offer:数字序列中某一位的数字2019-07-10 19:55:05

    题目描述数字以0123456789101112131415…的格式序列化到一个字符序列中。在这个序列中,第5位(从0开始计数)是5,第13位是1,第19位是4,等等。请写一个函数,求任意第n位对应的数字。 # -*- coding: utf-8 -*- # @Time : 2019-07-09 22:51 # @Author : Jayce Wong # @ProjectNam

  • 1066 Last non-zero Digit in N!2019-07-08 11:57:28

    题目做不出 看答案:参考文献  https://www.xuebuyuan.com/1394116.html https://blog.csdn.net/orangesix/article/details/44190501(在下面的8/2还是什么 只要因子2的数量还有 都不会尾数绝对不会是奇数) http://blog.sina.com.cn/s/blog_59e67e2c0100a7yx.html(里面讲了两种解法

  • 模板:大数阶乘2019-07-06 23:55:56

    #include <stdio.h>int main(){ const int maxn = ...; //n的阶乘所得的值的大致位数 int a[maxn];//储存每一位所得到的数 int temp,digit,n,i,j=0;//temp每次的得数 digit每次得数的位数 scanf("%d",&n); a[0]=1;//从1开始乘 digit=1;//位数从第

  • CodeChef Chef and Digit Jumps 题解2019-07-05 23:55:54

    原题链接:Chef and Digit Jumps 题意:原题中有链接。 题解:一道很明显的bfs题,就是跳就可以了,当然,跳的时候可以加一些优化,具体看代码 #include <queue> #include <cstdio> #include <cstring> using namespace std; #define Maxn 100000 char s[Maxn+5]; int n; int a[Maxn+5]; queue<i

  • Prime Path POJ-31262019-06-27 21:55:10

    The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of security to change such things every now and then, to keep

  • LeetCode-233 Number of Digit One2019-06-27 20:39:30

    题目描述 Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.   题目大意 计算[0, n]之间的数字中包含多少1 。   示例 E1 Input: 13Output: 6 Explanation: Digit 1 occurred in the following numbers

  • 43. Multiply Strings2019-06-26 11:51:58

    一、题目描述 ​​​数字字符串相乘,输入2个数字字符串,输出他们相乘的结果,例如 Input: num1 = "2", num2 = "3" Output: "6" 二、思路 1.两数相乘,结果的长度不会大于两数长度和 2.如果输入为0,则输出0 3.当输入不为0时,双重循环遍历对应位数相乘的结果 4.求进位和本位 5.将非0数

  • 程序虽小,智慧并存2019-06-22 19:02:13

    概述 在IT行业中,通常被人称为:码农,程序猿。在日常开发中,我们不能满足于代码的搬运,不能只会百度搜索,Copy和Paste。犹记春节假期,走亲访友,觥筹交错,席间有一位长辈问:你现在做什么工作呀?我很骄傲地说:我目前是系统架构师,主要负责系统的优化与重构。可是他却愣了很久,但当表妹在旁边补上

  • Kaggle练习001--Digit Recognizer(MNIST)2019-06-21 21:03:25

    MNIST数字识别是机器学习项目的经典案例,在Kaggle上也有此项比赛,本文中的代码是使用TensorFlow+CNN进行处理的。 我已将代码放到了我的Github上,有兴趣的朋友可以看一下。 一共四个文件: main.py是主程序模块。 trainModel.py是训练模型模块。 constantInit.py用于参数初始化。 dataL

  • js将数字转换为带有单位的中文表示2019-06-17 08:51:48

    好不容易找到了, 实测可行, 记录一下。 /** * 为数字加上单位:万或亿 * * 例如: * 1000.01 => 1000.01 * 10000 => 1万 * 99000 => 9.9万 * 566000 => 56.6万 * 5660000 => 566万 * 44440000 => 4444万 * 11111000 => 1111.1万

  • 关于Character的digit,forDigit,getNumericValue方法的一点理解2019-06-12 17:38:12

    Character类是一个包装类。 char这种数据类型是基于原始的Unicode编码的,储存一个char用16个bit,因此定义characters也是16位定长的实体集合。Unicode编码标准发生了变化,数量级从\uFFFF到了\u10FFFF 对Unicode标准中的所有字符,16位已经是不够的了,即一部分字符并不能通过char来表示了

  • 36期第三周作业2019-06-12 12:55:23

    1,定义一个对所有用户都生效的用户别名,例如: lftps=‘lftp 172.168.0.1/pub’ vim /etc/bashrcalias lftps=‘lftp 172.168.0.1/pub’. /etc/bashrc 2,显示/etc/passwd 文件中不以/bin/bash结尾的行 grep -v "/bin/bash$" /etc/passwd 3,找出/etc/passwd 中包含两位或三位数字的行 gre

  • leetcode 5078. 负二进制数相加(Adding Two Negabinary Numbers)2019-06-04 15:50:53

    目录 题目描述: 示例: 解法: 题目描述: 给出基数为 -2 的两个数 arr1 和 arr2,返回两数相加的结果。 数字以 数组形式 给出:数组由若干 0 和 1 组成,按最高有效位到最低有效位的顺序排列。例如,arr = [1,1,0,1] 表示数字 (-2)^3 + (-2)^2 + (-2)^0 = -3。数组形式 的数字也同样不含前

  • C++ hdu 例题:不要62 题解2019-05-25 22:38:14

    例题:不要62 同步数位DP 需要统计区间[l,r]的满足题意的数的个数,这往往可以转换成求[0,r]-[0,l)     基本思想与方法 有了上述性质,我们就可以从高到低枚举第一次<n对应位是哪一位。 这样之前的位确定了,之后的位就不受n的限制即从00...0~99...9,可以先预处理,然后这时就可以直接统计

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

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

ICode9版权所有