链接:https://www.nowcoder.com/acm/contest/163/F 来源:牛客网 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it 时间限制:C/C++ 3秒,其他语言6秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 There is a matrix A that has N rows and M columns. Each grid (i,j)(0 ≤ i < N,…
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 H - A Simple Problem with Integers (线段树,循环节) 链接:https://ac.nowcoder.com/acm/contest/163/H 来源:牛客网 链接:https://ac.nowcoder.com/acm/contest/163/H来源:牛客网 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %ll…
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it (扫描线) 链接:https://ac.nowcoder.com/acm/contest/163/F来源:牛客网 时间限制:C/C++ 3秒,其他语言6秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 There is a matrix A that has N rows and M columns. Each grid (i,j)(0 ≤ i…
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 J Beautiful Numbers (数位DP) 链接:https://ac.nowcoder.com/acm/contest/163/J?&headNav=acm来源:牛客网 时间限制:C/C++ 8秒,其他语言16秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 NIBGNAUK is an odd boy and his taste is strange a…
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 D Thinking-Bear magic (几何) 链接:https://ac.nowcoder.com/acm/contest/163/D来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 In order to become a magical girl, Thinking-Bear are learning m…
题目链接:https://ac.nowcoder.com/acm/contest/163/J 题目大意:给定一个数N,求区间[1,N]中满足可以整除它各个数位之和的数的个数.(1 ≤ N ≤ 1012). 输入: 21018 输出: Case 1: 10Case 2: 12 解题思路:比较简单的一道数位dp题,因为N的范围最大可为10的十二次方,即数位和的范围为[1,108],1-108的最小公倍数很大不可求,所以我们直接暴力枚举数位和为1-108的情况,然后利用数位dp求出合法数的个数就可以了…
A链接:https://www.nowcoder.com/acm/contest/163/A Fruit Ninja is a juicy action game enjoyed by millions of players around the world, with squishy, splat and satisfying fruit carnage! Become the ultimate bringer of sweet, tasty destruction with every sl…
题目描述 We consider a positive integer perfect, if and only if it is equal to the sum of its positive divisors less than itself. For example, 6 is perfect because 6 = 1 + 2 + 3. Could you write a program to determine if a given number is perfect or not?…
题目描述 In mathematics, matrix multiplication or matrix product is a binary operation that produces a matrix from two matrices with entries in a field, or, more generally, in a ring or even a semiring. The matrix product is designed for representing the…
Travel There are nn planets in the MOT galaxy, and each planet has a unique number from 1 \sim n1∼n. Each planet is connected to other planets through some transmission channels. There are mm transmission channels in the galaxy. Each transmission cha…