Some natural number was written on the board. Its sum of digits was not less than k. But you were distracted a bit, and someone changed this number to n, replacing some digits with others. It's known that the length of the number didn't change. You h…
引子: A题过于简单导致不敢提交,拖拖拉拉10多分钟还是决定交,太冲动交错了CE一发,我就知道又要错过一次涨分的机会.... B题还是过了,根据题意目测数组大小开1e5,居然蒙对,感觉用vector更好一点... C题WA第9组,GG思密达....明天起床再补C吧 - - 题目链接: http://codeforces.com/contest/835/problem/B B. The number on the board Some natural number was written on t…
Some natural number was written on the board. Its sum of digits was not less than k. But you were distracted a bit, and someone changed this number to n, replacing some digits with others. It's known that the length of the number didn't change. You h…
Prime Number CodeForces - 359C Simon has a prime number x and an array of non-negative integers a1, a2, ..., an. Simon loves fractions very much. Today he wrote out number on a piece of paper. After Simon led all fractions to a common denominator and…
1 题目描述: 被给一系列的正整数x1,x2,x3...xn和两个非负整数a和b,通过下面两步操作将a转化为b: 1.对当前的a减1. 2.对当前a减去a % xi (i=1,2...n). 计算a转化到b最小需要的最短步数. 2 输入 第一行包含简单的整数n(1 ≤  n ≤ 10^5),第二行包含n个用空格分开的整数x1,x2,x3...xn(2 ≤  xi ≤ 10^9),第三行包含两个整数a和b(0  ≤ b ≤  a ≤ 10^9, a - b ≤ 10^6). 3 输出 输出一个整数…
cf劲啊 原题: We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of substrings "ab" in the string and replace it with the string "bba". If we have no "ab" as a substring,…
Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing behind him. Find the number of different positions Pe…
[Link]:http://codeforces.com/contest/835 [Description] 原本有一个数字x,它的各个数码的和原本是>=k的; 现在这个数字x,在不改变位数的情况下,变成了n; 问你n和原来的数字x最少可能有多少位不一样. (x是未知的) [Solution] 如果各位大于等于k,直接输出0; 否则,先把n小的数码加到9; 一直加知道大于等于k; [NumberOf WA] 0 [Reviw] [Code] #include <bits/stdc++.h>…
题意:给定一个长度为偶数的数,输出小于它的最大的美丽数.如果一个数长度为偶数,且没有前导零,并存在一种排列是回文数的数为美丽数.给定的t个数长度总和不超过200000. 分析: 1.存在一种排列为回文数,即这个数包含的数字都是偶数个. 2.预处理出每个数字的个数. 3.从最右边一位依次往左枚举,当逐渐减小第i位时,统计目前的数中,第i位之前有多少个数字是奇数个,记为cnt. 4.因为第i位之后的数字可以随便填,所以如果第i位之后数字的个数大于等于cnt,那么则可以得出答案,大于的部分先用9填充,…
how to display number of replies in disscussion board I have a require about display the replies' number in disscussion board, finish it via jQuery. First, get the number of the replies of each items via client object model, then store the number int…
Problem UVA11491-Erasing ans Winning Accept: 799  Submit: 5753Time Limit: 3000 mSec Problem Description Juliano is a fan of the TV show Erasing and Winning, where participants are selected in a draw and receive money for taking part in the show. In t…
System Board Replacement Notice System Board Replacement Notice for TP 770E and TP 600 Restoring the System Unit Serial Number: The EEPROM on the system board contains vital product data (VPD), such as the system unit serial number and the system boa…
Codeforce 660 D. Number of Parallelograms 解析(幾何) 今天我們來看看CF660D 題目連結 題目 給你一些點,求有多少個平行四邊形. 前言 @copyright petjelinux 版權所有 觀看更多正版原始文章請至petjelinux的blog 想法 注意到,只要有兩個等長的平行邊,那我們就找到了一個平行四邊形了. 所以只要用一個\(map\)紀錄每個線段出現的次數,且每次加入一個線段(我們枚舉線段)時,先把答案加上目前有多少等長平行線段,最後答案…
A. Key races 题目链接:http://codeforces.com/contest/835/problem/A 题目意思:两个比赛打字,每个人有两个参数v和t,v秒表示他打每个字需要多久时间,等这个这个字传递过去需要t秒,而且在打第一个字之前也会有一个反应时间t.问第一个人可不可以获胜. 题目思路:这个题目当时题目没读懂,明白之后就是一个非常简单的题目了. (s*v1+2*t1)<(s*v2+2*t2)第一个人就可以获胜 (s*v1+2*t1)==(s*v2+2*t2) 就会平局,否…
The Game 题意: Description One morning, you wake up and think: "I am such a good programmer. Why not make some money?" So you decide to write a computer game. 一天清晨,你起床后想到:"我是一个这么牛的程序员,为什么不赚点钱呢?"所以,你决定写一个电脑游戏. The game takes place on a re…
给初学者的一直有很多人问我阻抗怎么计算的. 人家问多了,我想给大家整理个材料,于己于人都是个方便.如果大家还有什么问题或者文档有什么错误,欢迎讨论与指教!在计算阻抗之前,我想很有必要理解这儿阻抗的意义. 传输线阻抗的由来以及意义传输线阻抗是从电报方程推导出来(具体可以查询微波理论)如下图,其为平行双导线的分布参数等效电路: 从此图可以推导出电报方程 取传输线上的电压电流的正弦形式 得 推出通解  定义出特性阻抗 无耗线下r=0, g=0 得 注意,此特性阻抗和波阻抗的概念上的差异(具体查看平面波…
Problem D: Queens, Knights and PawnsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88443#problem/D Description You all are familiar with the famous 8-queens problem which asks you to place 8 queens…
Juliano is a fan of the TV show Erasing and Winning, where participants are selected in a draw and receive money for taking part in the show. In the show, the presenter writes a number of N digits in a board. The participant must then erase exactly D…
Problem Description background: Philip likes to play the QQ game of Snooker when he wants a relax, though he was just a little vegetable-bird. Maybe you hadn't played that game yet, no matter, I'll introduce the rule for you first. There are 21 objec…
B. The number on the board 题意: 有一个数字,它的每个数位上的数字的和不小于等于k.现在他改变了若干位,变成了一个新的数n,问现在的数和原来的数最多有多少位不同. 思路: 如果现在的数字各位数字之和大于等于k,那么它就可能没有被改变. 反之,那么每个数的最大改变量就是9减去这个数,于是把9减去每个数得到的结果从大到小排序,用k减去现在的数位和得到的结果记为kk,遍历一遍差量数组,用kk去减,知道kk小于0跳出. 代码: #include <stdio.h> #inc…
本文收录在Linux运维企业架构实战系列 一.收集切割公司自定义的日志 很多公司的日志并不是和服务默认的日志格式一致,因此,就需要我们来进行切割了. 1.需切割的日志示例 2018-02-24 11:19:23,532 [143] DEBUG performanceTrace 1145 http://api.114995.com:8082/api/Carpool/QueryMatchRoutes 183.205.134.240 null 972533 310000 TITTL00 HUAWEI…
本文收录在Linux运维企业架构实战系列 一.收集切割公司自定义的日志 很多公司的日志并不是和服务默认的日志格式一致,因此,就需要我们来进行切割了. 1.需切割的日志示例 2018-02-24 11:19:23,532 [143] DEBUG performanceTrace 1145 http://api.114995.com:8082/api/Carpool/QueryMatchRoutes 183.205.134.240 null 972533 310000 TITTL00 HUAWEI…
background: Philip likes to play the QQ game of Snooker when he wants a relax, though he was just a little vegetable-bird. Maybe you hadn't played that game yet, no matter, I'll introduce the rule for you first. There are 21 object balls on board, in…
一.环境搭建 源码包下载:git clone https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.10.8.tar.gz 或者直接去kernel.org上面进行下载. 交叉编译工具链制作: 这个已经在u-boot移植中已经做过了:http://www.cnblogs.com/kele-dad/p/6910040.html 二.内核启动过程 2.1 Windows 和 Linux 系统的启动区别 由bootloader确定启动哪块单板. 2.2…
乘风破浪:LeetCode真题_036_Valid Sudoku 一.前言 有的时候对于一些基础知识的掌握,对我们是至关重要的,比如ASCII重要字符的表示,比如一些基本类型的长度. 二.Valid Sudoku 2.1 问题 2.2 分析与解决 这样的问题可以说是比较简单了,我们只需要简单的按照规则进行检测就能得到相应的结果了,但是有没有更好一点的方法呢?我想应该是没有了. public class Solution { /** * 题目大意 * 验证一个数独棋盘是否合法,数独棋盘的验证规则见…
Description You all are familiar with the famous 8-queens problem which asks you to place 8 queens on a chess board so no two attack each other. In this problem, you will be given locations of queens and knights and pawns and asked to find how many o…
A. Game Outcome time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Sherlock Holmes and Dr. Watson played some game on a checkered board n × n in size. During the game they put numbers on the…
本文收录在Linux运维企业架构实战系列 一.收集切割公司自定义的日志 很多公司的日志并不是和服务默认的日志格式一致,因此,就需要我们来进行切割了. 1.需切割的日志示例 2018-02-24 11:19:23,532 [143] DEBUG performanceTrace 1145 http://api.114995.com:8082/api/Carpool/QueryMatchRoutes 183.205.134.240 null 972533 310000 TITTL00 HUAWEI…
The Game Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9746   Accepted: 2967 Description One morning, you wake up and think: "I am such a good programmer. Why not make some money?'' So you decide to write a computer game. The game take…
The Game 题意: Description One morning, you wake up and think: "I am such a good programmer. Why not make some money?" So you decide to write a computer game. 一天清晨,你起床后想到:"我是一个这么牛的程序员,为什么不赚点钱呢?"所以,你决定写一个电脑游戏. The game takes place on a re…